/**
 * Image Metadata Tool — Studio UI v3.0.0
 * Author: Arslan
 * Clean editorial-SaaS aesthetic. High-specificity to beat WP themes.
 */

/* ═══════════════════════════════════════════
   RESET (scoped)
═══════════════════════════════════════════ */
html body #imt-app-root,
html body #imt-app-root * { box-sizing: border-box !important; -webkit-font-smoothing: antialiased; }

html body #imt-app-root {
  --bg:        #f3f2ef;
  --card:      #ffffff;
  --ink:       #1a1a1c;
  --ink-soft:  #595650;
  --ink-mute:  #a3a09a;
  --line:      #e9e7e2;
  --line-in:   #e4e2dc;
  --line-soft: #f0eee9;
  --auto-bg:   #f8f7f4;
  --primary:   #5b63e8;
  --primary-d: #4a51d6;
  --primary-bg:#eef0fe;
  --primary-bd:#d8dcfb;
  --ok:        #1a9d54;
  --ok-bg:     #e7f4ec;
  --mono:      ui-monospace, "SF Mono", "Menlo", "Cascadia Code", "Roboto Mono", monospace;
  --sans:      -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", system-ui, sans-serif;

  font-family: var(--sans) !important;
  color: var(--ink) !important;
  background: transparent !important;
  line-height: 1.5 !important;
  font-size: 15px !important;
  letter-spacing: -0.005em;
  padding: 30px 0 64px !important;
  max-width: 1220px !important;
  margin: 0 auto !important;
}
html body #imt-app-root h1,
html body #imt-app-root h2,
html body #imt-app-root p,
html body #imt-app-root label { margin: 0 !important; padding: 0 !important; font-family: var(--sans) !important; }
html body #imt-app-root button { font-family: var(--sans) !important; cursor: pointer; }
html body #imt-app-root input,
html body #imt-app-root textarea { font-family: var(--sans) !important; margin: 0 !important; }

/* ═══════════════════════════════════════════
   API-KEY NOTICE
═══════════════════════════════════════════ */
html body #imt-app-root .imt-notice {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 11px 15px; border-radius: 11px; margin-bottom: 20px;
  border: 1px solid #f1dca9; background: #fdf7e7; color: #8a6d1f;
}
html body #imt-app-root .imt-notice a { color: #8a6d1f; font-weight: 600; text-decoration: underline; }

/* ═══════════════════════════════════════════
   PAGE TITLE + STEP PILLS (title left, pills right)
═══════════════════════════════════════════ */
html body #imt-app-root .imt-page-title {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 26px;
}
html body #imt-app-root .imt-page-title-left { flex: 1; min-width: 0; }
html body #imt-app-root .imt-page-h {
  font-size: 38px !important; font-weight: 650; letter-spacing: -.025em; line-height: 1.05; color: var(--ink); margin: 0;
}
html body #imt-app-root .imt-page-title p {
  margin-top: 11px !important; color: var(--ink-soft); font-size: 15px; max-width: 560px; line-height: 1.5;
}
html body #imt-app-root .imt-steps { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; flex: none; padding-top: 6px; }
html body #imt-app-root .imt-step {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 15px 7px 8px; border-radius: 9999px; font-size: 13.5px;
  color: var(--ink-mute); font-weight: 500; transition: all .2s ease;
}
html body #imt-app-root .imt-steps .imt-step-num {
  width: 21px; height: 21px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; background: #e6e3dc; color: var(--ink-soft);
}
html body #imt-app-root .imt-steps .imt-step-num svg { width: 11px; height: 11px; }
/* Active: white background, dark text (not black bg) */
html body #imt-app-root .imt-step--active { background: #fff !important; color: var(--ink) !important; box-shadow: 0 1px 4px rgba(20,18,15,.12); }
html body #imt-app-root .imt-step--active .imt-step-num { background: var(--ink) !important; color: #fff !important; }
/* Done: green tick */
html body #imt-app-root .imt-step--done { color: var(--ok) !important; }
html body #imt-app-root .imt-step--done .imt-step-num { background: var(--ok) !important; color: #fff !important; }

/* ═══════════════════════════════════════════
   GRID — right column sticky
═══════════════════════════════════════════ */
html body #imt-app-root .imt-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 392px; gap: 24px; align-items: start;
}
html body #imt-app-root .imt-col--main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
html body #imt-app-root .imt-col--side {
  position: sticky; top: 22px; align-self: start; display: flex; flex-direction: column; gap: 22px;
}

/* ═══════════════════════════════════════════
   CARD
═══════════════════════════════════════════ */
html body #imt-app-root .imt-step-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px !important;
  box-shadow: 0 1px 2px rgba(20,18,15,.03), 0 14px 40px -26px rgba(20,18,15,.22);
}
html body #imt-app-root .imt-step-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
html body #imt-app-root .imt-step-head .imt-step-num {
  width: 28px; height: 28px; flex: none; border-radius: 9px; background: var(--ink); color: #fff;
  font-size: 13.5px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
html body #imt-app-root .imt-step-info { flex: 1; min-width: 0; }
html body #imt-app-root .imt-step-badge { flex: none; margin-left: auto; }
@media (min-width: 768px) {
  html body #imt-app-root .imt-step-head .imt-step-num { margin-top: 10px; }
  html body #imt-app-root .imt-step-info { margin-top: 6px; }
  html body #imt-app-root .imt-step-badge { margin-top: 9px; }
}
html body #imt-app-root .imt-step-title {
  font-size: 17px; font-weight: 550; letter-spacing: -.015em; line-height: 1.2;
}
html body #imt-app-root .imt-step-desc { margin-top: 3px; font-size: 13.5px; color: var(--ink-soft); }
html body #imt-app-root .imt-step-action { flex: none; }
html body #imt-app-root .imt-step-body { display: flex; flex-direction: column; gap: 18px; }
html body #imt-app-root .imt-step-body--locked { opacity: .5; pointer-events: none; user-select: none; }
html body #imt-app-root .imt-step-body--locked .imt-input,
html body #imt-app-root .imt-step-body--locked .imt-textarea { background: #f6f5f1 !important; }
html body #imt-app-root .imt-pv-img-wrap--empty { display: flex; align-items: center; justify-content: center; color: var(--ink-mute); }

/* Status badge */
html body #imt-app-root .imt-status {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  padding: 5px 12px; border-radius: 9999px;
}
html body #imt-app-root .imt-status svg { width: 7px; height: 7px; }
html body #imt-app-root .imt-status--ok { background: var(--ok-bg); color: var(--ok); }
html body #imt-app-root .imt-status--idle { background: #f0eee9; color: var(--ink-mute); }

/* ═══════════════════════════════════════════
   UPLOAD ZONE
═══════════════════════════════════════════ */
html body #imt-app-root .imt-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px !important; text-align: center;
  cursor: pointer; border: 1.5px dashed #cdcabf !important; border-radius: 14px;
  padding: 44px 28px !important; margin: 12px !important;
  background: #f6f5f1; transition: border-color .18s, background .18s;
}
html body #imt-app-root .imt-drop:hover,
html body #imt-app-root .imt-drop.imt-drag-over { border-color: var(--primary) !important; background: var(--primary-bg); }
html body #imt-app-root .imt-drop-ico {
  width: 68px; height: 68px; border-radius: 16px; flex: none; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #ebe9e3; color: #3f4350; box-shadow: 0 10px 22px -10px rgba(20,18,15,.3); margin-bottom: 6px;
}
/* Let the SVG's own width/height attributes control size — no CSS override */
html body #imt-app-root .imt-drop-ico svg { width: unset !important; height: unset !important; }
html body #imt-app-root .imt-drop-title { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
html body #imt-app-root .imt-drop-sub { font-size: 14px; color: var(--ink-soft); margin-top: -2px; }
html body #imt-app-root .imt-drop-cta-row {
  display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 16px;
}
html body #imt-app-root .imt-drop-cta {
  background: var(--primary); color: #fff; font-weight: 600; font-size: 14px;
  padding: 11px 22px; border-radius: 10px; box-shadow: 0 6px 16px -5px rgba(91,99,232,.6); transition: filter .15s;
}
html body #imt-app-root .imt-drop:hover .imt-drop-cta { filter: brightness(1.06); }
html body #imt-app-root .imt-drop-formats {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: center;
  font-size: 12.5px; color: var(--ink-mute);
}
html body #imt-app-root .imt-drop-dot { color: #d2cfc7; }
html body #imt-app-root .imt-drop-formats b,
html body #imt-app-root .imt-kbd {
  font-family: var(--mono); font-weight: 500; background: #fff; color: var(--ink-soft);
  border: 1px solid var(--line-in); padding: 2px 7px; border-radius: 6px; font-size: 11px;
}
html body #imt-app-root .imt-file-input {
  position: fixed !important; top: 0 !important; left: -9999px !important;
  width: 0 !important; height: 0 !important; opacity: 0 !important; pointer-events: none !important;
}

/* Thumbnail strip */
html body #imt-app-root .imt-thumbs { display: flex; flex-wrap: wrap; gap: 11px; }
html body #imt-app-root .imt-thumb {
  position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden;
  border: 2px solid var(--line); cursor: pointer; transition: border-color .15s, transform .12s;
}
html body #imt-app-root .imt-thumb:hover { transform: translateY(-1px); }
html body #imt-app-root .imt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
html body #imt-app-root .imt-thumb--on { border-color: var(--primary); }
html body #imt-app-root .imt-thumb-check {
  position: absolute; top: 4px; left: 4px; width: 19px; height: 19px; border-radius: 50%;
  background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
html body #imt-app-root .imt-thumb-check svg { width: 10px; height: 10px; }
html body #imt-app-root .imt-thumb-x {
  position: absolute; top: 3px; right: 3px; width: 19px; height: 19px; border: none; border-radius: 50%;
  background: rgba(20,18,15,.7); color: #fff; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s;
}
html body #imt-app-root .imt-thumb:hover .imt-thumb-x { opacity: 1; }

/* ── Loaded image detail (reference 3) ── */
html body #imt-app-root .imt-img-detail { display: flex; align-items: center; gap: 22px; }
html body #imt-app-root .imt-img-thumb {
  width: 168px; height: 116px; flex: none; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: #faf9f6;
}
html body #imt-app-root .imt-img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
html body #imt-app-root .imt-img-meta { flex: 1; min-width: 0; }
html body #imt-app-root .imt-img-name {
  font-size: 17px; font-weight: 550; letter-spacing: -.01em; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html body #imt-app-root .imt-img-specs {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); margin-top: 7px;
}
html body #imt-app-root .imt-meta-dot { color: #cfccc3; }
html body #imt-app-root .imt-img-actions { display: flex; gap: 9px; margin-top: 16px; }
html body #imt-app-root .imt-btn--ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
html body #imt-app-root .imt-btn--ghost:hover { background: #f4f2ec; color: #c2453b; border-color: transparent; }

/* Add tile in the multi-image strip */
html body #imt-app-root .imt-thumb--add {
  display: flex; align-items: center; justify-content: center; color: var(--ink-mute);
  border: 2px dashed #d4d1c8; background: #faf9f6; transition: border-color .15s, color .15s;
}
html body #imt-app-root .imt-thumb--add:hover { border-color: var(--primary); color: var(--primary); transform: none; }

/* Subtle "add another" link (single-image state) */
html body #imt-app-root .imt-add-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  border: 1px solid var(--line-in); border-radius: 9px; padding: 8px 13px !important; transition: all .15s; width: max-content;
}
html body #imt-app-root .imt-add-link:hover { background: #f7f6f2; color: var(--ink); border-color: var(--line); }
html body #imt-app-root .imt-add-link svg { width: 14px; height: 14px; }

/* ═══════════════════════════════════════════
   FIELDS / INPUTS
═══════════════════════════════════════════ */
html body #imt-app-root .imt-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
html body #imt-app-root .imt-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
html body #imt-app-root .imt-field-label {
  font-size: 13.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px;
}
html body #imt-app-root .imt-opt-inline { font-size: 12px; font-weight: 400; color: var(--ink-mute); }
html body #imt-app-root .imt-field-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px;
}
html body #imt-app-root .imt-field-head-btns { display: flex; gap: 6px; }
html body #imt-app-root .imt-loc-detected {
  font-size: 11px; font-weight: 600; color: var(--primary); background: var(--primary-bg);
  border: 1px solid var(--primary-bd); padding: 2px 9px; border-radius: 9999px;
  max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

html body #imt-app-root .imt-input,
html body #imt-app-root .imt-textarea {
  width: 100% !important; border: 1px solid var(--line-in) !important; background: #fff !important;
  border-radius: 11px !important; padding: 12px 14px !important; font-size: 14.5px !important;
  color: var(--ink) !important; outline: none !important; box-shadow: none !important;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
html body #imt-app-root .imt-input::placeholder,
html body #imt-app-root .imt-textarea::placeholder { color: var(--ink-mute) !important; }
html body #imt-app-root .imt-input:focus,
html body #imt-app-root .imt-textarea:focus {
  border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(91,99,232,.15) !important;
}
html body #imt-app-root .imt-textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
html body #imt-app-root .imt-textarea--lg { min-height: 132px; }
html body #imt-app-root .imt-input--auto { background: var(--auto-bg) !important; }
html body #imt-app-root .imt-input--mono { font-family: var(--mono) !important; font-size: 13.5px !important; }

/* Filename + extension */
html body #imt-app-root .imt-fn-row { position: relative; display: flex; align-items: center; }
html body #imt-app-root .imt-input--nor { padding-right: 58px !important; font-family: var(--mono) !important; font-size: 13px !important; }
html body #imt-app-root .imt-fn-ext {
  position: absolute; right: 8px; font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--ink-soft); background: #f1efe9; padding: 3px 8px; border-radius: 6px;
}

/* AI chip */
html body #imt-app-root .imt-chip { font-size: 9.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 5px; }
html body #imt-app-root .imt-chip--ai { background: var(--primary-bg); color: var(--primary); }
html body #imt-app-root .imt-chip--exist { background: #e7f4ec; color: #1a7d49; text-transform: uppercase; }
html body #imt-app-root .imt-exist-notice {
  display: flex; align-items: flex-start; gap: 10px;
  background: #f0f7f2; border: 1px solid #cfe7d8; color: #1c5e3a;
  border-radius: 12px; padding: 13px 15px; margin-bottom: 18px; font-size: 13.5px; line-height: 1.5;
}
html body #imt-app-root .imt-exist-notice svg { flex: none; margin-top: 2px; color: #1a9d54; }
html body #imt-app-root .imt-exist-notice .imt-chip--exist { vertical-align: middle; }

/* ═══════════════════════════════════════════
   LOCATION SEARCH
═══════════════════════════════════════════ */
html body #imt-app-root .imt-search-wrap { position: relative; z-index: 9999; }
html body #imt-app-root .imt-search-field { position: relative; display: flex; align-items: center; }
html body #imt-app-root .imt-search-icon-el { position: absolute; left: 13px; color: var(--ink-mute); display: flex; pointer-events: none; z-index: 2; }
html body #imt-app-root .imt-search-field input.imt-input.imt-input--search { padding-left: 38px !important; padding-right: 52px !important; }
html body #imt-app-root .imt-search-btn {
  position: absolute; right: 6px; border: none; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  padding: 8px 15px; border-radius: 9px; display: inline-flex; align-items: center; gap: 6px; z-index: 2; transition: filter .15s;
}
html body #imt-app-root .imt-search-btn:hover { filter: brightness(1.4); }
html body #imt-app-root .imt-search-btn svg { width: 12px; height: 12px; }
html body #imt-app-root .imt-search-btn--ghost { background: #f1efe9; color: var(--ink-soft); padding: 8px 10px; }
html body #imt-app-root .imt-search-btn--ghost:hover { filter: none; background: #e9e6df; }
html body #imt-app-root .imt-suggestions {
  position: absolute; top: calc(100% + 7px); left: 0; right: 0; z-index: 10000; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden auto; max-height: 280px;
  box-shadow: 0 16px 40px -10px rgba(20,18,15,.25);
}
html body #imt-app-root .imt-sug-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-size: 13.5px; cursor: pointer;
  border-bottom: 1px solid var(--line-soft); color: var(--ink-soft);
}
html body #imt-app-root .imt-sug-item:last-child { border-bottom: none; }
html body #imt-app-root .imt-sug-item:hover { background: #f7f6f2; color: var(--ink); }
html body #imt-app-root .imt-sug-item svg { flex: none; color: var(--ink-mute); }
html body #imt-app-root .imt-sug-loading,
html body #imt-app-root .imt-sug-empty { padding: 15px; font-size: 13.5px; color: var(--ink-mute); text-align: center; }

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
html body #imt-app-root .imt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-in); background: #fff; color: var(--ink-soft);
  font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 9px; transition: all .15s; line-height: 1; white-space: nowrap;
}
html body #imt-app-root .imt-btn:hover { background: #f7f6f2; color: var(--ink); border-color: var(--line); }
html body #imt-app-root .imt-btn:disabled { opacity: .55; cursor: not-allowed; }
html body #imt-app-root .imt-btn svg { width: 13px; height: 13px; }
html body #imt-app-root .imt-btn--sm { padding: 7px 12px; font-size: 12.5px; }
html body #imt-app-root .imt-btn--ai { color: #000000 !important; }
html body #imt-app-root .imt-btn--ai svg { color: #000000 !important; stroke: #000000 !important; }
html body #imt-app-root .imt-btn--ai:hover { background: var(--primary-bg); border-color: var(--primary-bd); color: #000000 !important; }
html body #imt-app-root .imt-btn--primary {
  background: var(--primary); border: none; color: #fff; box-shadow: 0 8px 20px -7px rgba(91,99,232,.7);
}
html body #imt-app-root .imt-btn--primary:hover { background: var(--primary-d); }
html body #imt-app-root .imt-btn--full { width: 100%; }
html body #imt-app-root .imt-btn--lg { padding: 14px; font-size: 15px; font-weight: 650; border-radius: 12px; }

/* Spinner */
html body #imt-app-root .imt-spin {
  display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: imt-spin .6s linear infinite; vertical-align: -2px;
}
html body #imt-app-root .imt-spin--sm { width: 11px; height: 11px; border-width: 1.5px; }
@keyframes imt-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════
   LIVE PREVIEW
═══════════════════════════════════════════ */
html body #imt-app-root .imt-pv-img-wrap {
  position: relative !important; border-radius: 13px 13px 0 0 !important;
  overflow: hidden; border: 1px solid var(--line); background: #faf9f6; aspect-ratio: 16 / 10;
}
html body #imt-app-root .imt-pv-img { width: 100%; height: 100%; object-fit: cover; display: block; }
html body #imt-app-root .imt-pv-geo-overlay {
  position: absolute !important; bottom: 10px; right: 10px;
  background: rgba(16,15,13,.82); color: #fff;
  padding: 8px 12px; border-radius: 9px; font-family: var(--mono);
  font-size: 11px; line-height: 1.65; backdrop-filter: blur(3px);
}
html body #imt-app-root .imt-pv-geo-lbl { opacity: .65; letter-spacing: .08em; font-size: 10px; margin-right: 6px; }
html body #imt-app-root .imt-pv-geo-val { font-weight: 600; font-size: 11.5px; }
/* Live preview — tighter padding; warm bg only on data section below image */
html body #imt-app-root .imt-card--preview { background: #ffffff !important; padding: 12px !important; }
html body #imt-app-root .imt-card--preview .imt-step-head { margin-bottom: 16px; }
html body #imt-app-root .imt-card--preview .imt-step-body { gap: 0px; }
html body #imt-app-root .imt-pv-fields {
  background: #FBFAF6 !important;
  margin: 0 0px 0px 0px !important;
  padding: 18px 18px 18px 18px !important;
  border-radius: 0 0 13px 13px !important;
}
html body #imt-app-root .imt-pv-field { padding-top: 14px; border-top: 1px solid #e9e7e1; }
html body #imt-app-root .imt-pv-field:first-child { border-top: none; padding-top: 0; }
html body #imt-app-root .imt-pv-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--ink-mute); margin-bottom: 4px; }
html body #imt-app-root .imt-pv-value { font-size: 14px; color: var(--ink); line-height: 1.45; word-break: break-word; }
html body #imt-app-root .imt-pv-mono { font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); }
html body #imt-app-root .imt-pv-empty { color: var(--ink-mute); }

/* ═══════════════════════════════════════════
   EXPORT — format cards + compression
═══════════════════════════════════════════ */
html body #imt-app-root .imt-fmt-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; }
html body #imt-app-root .imt-fmt-card {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  border: 1.5px solid var(--line); border-radius: 13px; padding: 14px 15px !important; cursor: pointer; transition: all .15s;
}
html body #imt-app-root .imt-fmt-card:hover { border-color: #cdd0f4; background: #fafaff; }
html body #imt-app-root .imt-fmt-card--on { border-color: var(--primary); background: var(--primary-bg); }
html body #imt-app-root .imt-fmt-name { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
html body #imt-app-root .imt-fmt-desc { font-size: 11.5px; color: var(--ink-soft); line-height: 1.35; min-height: 30px; }
html body #imt-app-root .imt-fmt-size { font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
html body #imt-app-root .imt-fmt-size--load { color: var(--ink-mute); }
html body #imt-app-root .imt-radio {
  position: absolute; top: 14px; right: 14px; width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid #cfccc3; background: #fff; transition: all .15s;
}
html body #imt-app-root .imt-radio--on { border-color: var(--primary); border-width: 5px; }

html body #imt-app-root .imt-compress { padding-top: 2px; }
html body #imt-app-root .imt-compress-na {
  font-size: 11.5px; color: var(--ink-mute); font-style: italic;
  padding: 8px 12px; background: #f6f5f1; border-radius: 8px; border: 1px solid var(--line);
}
html body #imt-app-root .imt-toggle { display: flex; align-items: center; gap: 11px; cursor: pointer; }
html body #imt-app-root .imt-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
html body #imt-app-root .imt-toggle-track {
  width: 40px; height: 23px; border-radius: 9999px; background: #d9d6cd; position: relative; transition: background .18s; flex: none;
}
html body #imt-app-root .imt-toggle-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s;
}
html body #imt-app-root .imt-toggle input:checked + .imt-toggle-track { background: var(--primary); }
html body #imt-app-root .imt-toggle input:checked + .imt-toggle-track::after { transform: translateX(17px); }
html body #imt-app-root .imt-toggle-label { font-size: 14px; font-weight: 600; }
html body #imt-app-root .imt-quality { margin-top: 14px; }
html body #imt-app-root .imt-quality-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
html body #imt-app-root .imt-quality-lbl { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
html body #imt-app-root .imt-quality-val { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--primary); }
html body #imt-app-root .imt-range { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 9999px; background: #e6e3dc; outline: none; }
html body #imt-app-root .imt-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); cursor: pointer; box-shadow: 0 1px 4px rgba(91,99,232,.5); }
html body #imt-app-root .imt-range::-moz-range-thumb { width: 18px; height: 18px; border: none; border-radius: 50%; background: var(--primary); cursor: pointer; }

html body #imt-app-root .imt-export-line { font-size: 12.5px; color: var(--ink-soft); text-align: center; }
html body #imt-app-root .imt-export-line b { color: var(--ink); font-weight: 700; }
html body #imt-app-root .imt-export-note { font-size: 11.5px; color: var(--ink-mute); text-align: center; }

/* ═══════════════════════════════════════════
   BULK BAR
═══════════════════════════════════════════ */
html body #imt-app-root .imt-bulk {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px;
  box-shadow: 0 1px 2px rgba(20,18,15,.03), 0 14px 40px -26px rgba(20,18,15,.22);
}
html body #imt-app-root .imt-bulk-count { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
html body #imt-app-root .imt-bulk-btns { display: flex; gap: 9px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════
   SIDE EMPTY STATE
═══════════════════════════════════════════ */
html body #imt-app-root .imt-side-empty { text-align: center; padding: 44px 26px; }
html body #imt-app-root .imt-side-empty-ico {
  width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 15px; display: flex; align-items: center; justify-content: center;
  background: #faf9f6; border: 1px solid var(--line); color: var(--ink-mute);
}
html body #imt-app-root .imt-side-empty-title { font-size: 15.5px; font-weight: 650; }
html body #imt-app-root .imt-side-empty-sub { font-size: 13.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.5; }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Full mobile / tablet / desktop system
   Breakpoints: 480 · 700 · 980 · 1259
═══════════════════════════════════════════════════════════════ */

/* ── Container side-padding on non-wide screens ── */
@media (max-width: 1259px) {
  html body #imt-app-root { padding-left: 18px !important; padding-right: 18px !important; }
}
/* Wide screens: break out of narrow theme containers */
@media (min-width: 1260px) {
  html body #imt-app-root {
    width: 1220px !important; max-width: 1220px !important;
    position: relative !important; left: 50% !important;
    margin-left: -610px !important; margin-right: 0 !important;
    padding-left: 0 !important; padding-right: 0 !important;
  }
}

/* ── Tablet & below (≤ 980px): single-column grid ── */
@media (max-width: 980px) {
  html body #imt-app-root .imt-grid { grid-template-columns: 1fr; gap: 18px; }
  html body #imt-app-root .imt-col--side { position: static; }

  /* Page title + steps: stack vertically */
  html body #imt-app-root .imt-page-title {
    flex-direction: column; align-items: flex-start; gap: 14px;
  }
  html body #imt-app-root .imt-steps { padding-top: 0; }

  /* Side column order: show after main on tablet, reduce padding */
  html body #imt-app-root .imt-card--preview { padding: 14px !important; }
  html body #imt-app-root .imt-pv-fields {
    margin: 0 -14px -14px -14px !important;
    padding: 16px 14px 18px !important;
    border-radius: 0 0 11px 11px !important;
  }

  /* Format cards: 3 → 2 columns */
  html body #imt-app-root .imt-fmt-grid { grid-template-columns: 1fr 1fr; }

  /* Top padding reduce */
  html body #imt-app-root { padding-top: 24px !important; }
}

/* ── Mobile (≤ 700px): aggressive layout adjustments ── */
@media (max-width: 700px) {
  /* Page title smaller */
  html body #imt-app-root .imt-page-h { font-size: 28px !important; }
  html body #imt-app-root .imt-page-title p { font-size: 14px; }

  /* Cards: less padding */
  html body #imt-app-root .imt-step-card { padding: 18px !important; }
  html body #imt-app-root .imt-card--preview { padding: 12px !important; }

  /* 2-col grids (keyword + business name) → 1 col */
  html body #imt-app-root .imt-grid-2 { grid-template-columns: 1fr; gap: 12px; }

  /* Format cards: 2 col stays but padding tighter */
  html body #imt-app-root .imt-fmt-card { padding: 11px 12px !important; }
  html body #imt-app-root .imt-fmt-name { font-size: 13px; }
  html body #imt-app-root .imt-fmt-desc { font-size: 11.5px; }
  html body #imt-app-root .imt-fmt-size { font-size: 11px; }

  /* Step head: number + badge margin-top reduce */
  html body #imt-app-root .imt-step-head .imt-step-num { margin-top: 2px; }
  html body #imt-app-root .imt-step-info { margin-top: 0; }
  html body #imt-app-root .imt-step-badge { margin-top: 2px; }
  html body #imt-app-root .imt-step-title { font-size: 15px; }

  /* Step pills: hide labels, show numbers only */
  html body #imt-app-root .imt-step-label { display: none; }
  html body #imt-app-root .imt-step { padding: 6px 10px 6px 6px; font-size: 12px; }

  /* Drop zone: compact */
  html body #imt-app-root .imt-drop { padding: 28px 16px !important; }
  html body #imt-app-root .imt-drop-ico { width: 56px; height: 56px; }
  html body #imt-app-root .imt-drop-title { font-size: 17px; }
  html body #imt-app-root .imt-drop-sub { font-size: 13px; }

  /* Image detail row */
  html body #imt-app-root .imt-img-detail { gap: 10px; }
  html body #imt-app-root .imt-img-thumb { width: 52px; height: 52px; }
  html body #imt-app-root .imt-img-name { font-size: 14px; }
  html body #imt-app-root .imt-img-specs { font-size: 11px; }

  /* Buttons */
  html body #imt-app-root .imt-btn--full { width: 100%; }
  html body #imt-app-root .imt-btn--lg { padding: 13px 18px !important; font-size: 14px; }

  /* Download button full-width on mobile */
  html body #imt-app-root #imt-dl-btn { width: 100% !important; justify-content: center; }

  /* Location search clear button adjust */
  html body #imt-app-root .imt-search-field input.imt-input.imt-input--search { padding-right: 72px !important; }

  /* Map smaller on mobile */
  html body #imt-app-root .imt-map { height: 150px; }

  /* Fields: label smaller */
  html body #imt-app-root .imt-field-label { font-size: 12px; }

  /* Live preview: tighter */
  html body #imt-app-root .imt-pv-fields {
    margin: 0 -12px -12px -12px !important;
    padding: 14px 12px 16px !important;
  }
  html body #imt-app-root .imt-pv-label { font-size: 10px; }
  html body #imt-app-root .imt-pv-value { font-size: 13px; }

  /* Export export-line smaller */
  html body #imt-app-root .imt-export-line { font-size: 13px; }
  html body #imt-app-root .imt-export-note { font-size: 11.5px; }

  /* Thumbnail strip: scrollable */
  html body #imt-app-root .imt-thumb-strip { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Top padding */
  html body #imt-app-root { padding-top: 18px !important; padding-bottom: 32px !important; }
}

/* ── Small mobile (≤ 480px): final adjustments ── */
@media (max-width: 480px) {
  html body #imt-app-root { padding-left: 12px !important; padding-right: 12px !important; }
  html body #imt-app-root .imt-page-h { font-size: 24px !important; }
  html body #imt-app-root .imt-step-card { padding: 14px !important; }
  html body #imt-app-root .imt-card--preview { padding: 10px !important; }
  html body #imt-app-root .imt-pv-fields {
    margin: 0 -10px -10px -10px !important;
    padding: 12px 10px 14px !important;
  }
  /* Format cards: 2 → 1 column on smallest screens */
  html body #imt-app-root .imt-fmt-grid { grid-template-columns: 1fr; }
  /* Step number smaller */
  html body #imt-app-root .imt-step-head .imt-step-num { width: 24px; height: 24px; font-size: 12px; }
  /* Drop zone cta row stack */
  html body #imt-app-root .imt-drop-cta-row { flex-direction: column; align-items: center; }
  html body #imt-app-root .imt-map { height: 130px; }
  html body #imt-app-root .imt-page-title p { display: none; } /* hide subtitle on very small */
}


/* PNG/image icons */
html body #imt-app-root .imt-ico-img {
  display: inline-block; vertical-align: middle; object-fit: contain;
  width: 1em; height: 1em;
}
html body #imt-app-root .imt-drop-ico .imt-ico-img { width: 36px; height: 36px; }
html body #imt-app-root .imt-btn .imt-ico-img { width: 14px; height: 14px; }
html body #imt-app-root .imt-steps .imt-step-num .imt-ico-img { width: 11px; height: 11px; }

/* ═══════════════════════════════════════════
   LOCATION MAP (Leaflet)
═══════════════════════════════════════════ */
html body #imt-app-root .imt-map-anchor { margin-top: 10px; }
html body #imt-app-root .imt-map {
  width: 100%; height: 180px; border-radius: 10px;
  overflow: hidden; border: 1px solid var(--line);
  background: #f0ede8;
}
html body #imt-app-root .imt-map .leaflet-attribution-flag { display: none !important; }
html body #imt-app-root .imt-map .leaflet-control-attribution {
  font-size: 9px !important; background: rgba(255,255,255,.7) !important;
}
html body #imt-app-root .imt-map .leaflet-control-zoom {
  border: none !important; box-shadow: 0 1px 5px rgba(0,0,0,.15) !important;
}
html body #imt-app-root .imt-map .leaflet-control-zoom a {
  border-radius: 6px !important; font-size: 14px !important;
}
html body #imt-app-root .imt-map-hint {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(255,255,255,.88); color: var(--ink-soft); font-size: 12.5px;
  padding: 6px 14px; border-radius: 20px; pointer-events: none;
  box-shadow: 0 1px 6px rgba(0,0,0,.12); white-space: nowrap; z-index: 1000;
}
/* Location clear (×) button */
html body #imt-app-root .imt-loc-clear {
  position: absolute; right: 46px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer;
  background: #e0deda; color: var(--ink-soft); font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center; z-index: 3;
  transition: background .15s, color .15s; padding: 0;
}
html body #imt-app-root .imt-loc-clear:hover { background: #c8c4be; color: var(--ink); }

/* Keep Leaflet controls below search suggestions */
html body #imt-app-root .imt-map .leaflet-top,
html body #imt-app-root .imt-map .leaflet-bottom { z-index: 400 !important; }
html body #imt-app-root .imt-map-hint { z-index: 400 !important; }

/* ═══════════════════════════════════════════════════════════
   IMAGE METADATA VIEWER — [imt_viewer] shortcode
   Scoped to #imt-viewer-root
═══════════════════════════════════════════════════════════ */
#imt-viewer-root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; color: #1a1a1c; max-width: 900px; margin: 0 auto;
  --vr-ink: #1a1a1c; --vr-soft: #6b6a68; --vr-mute: #9e9c99;
  --vr-card: #fff; --vr-bg: #f3f2ef; --vr-line: #e8e5df;
  --vr-primary: #5b63e8; --vr-ok: #1a9d54; --vr-radius: 14px;
}

/* ── Drop zone ── */
#imt-viewer-root .imtv-drop {
  border: 2px dashed var(--vr-line); border-radius: var(--vr-radius);
  background: var(--vr-card); cursor: pointer; transition: border-color .2s, background .2s;
}
#imt-viewer-root .imtv-drop:hover,
#imt-viewer-root .imtv-drop--over { border-color: var(--vr-primary); background: #f5f6ff; }
#imt-viewer-root .imtv-drop-inner {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 52px 24px; text-align: center;
}
#imt-viewer-root .imtv-drop-icon {
  width: 68px; height: 68px; background: #fff; border: 1px solid var(--vr-line);
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px -8px rgba(20,18,15,.2); color: var(--vr-soft); margin-bottom: 4px;
}
#imt-viewer-root .imtv-drop-title {
  font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--vr-ink);
}
#imt-viewer-root .imtv-drop-sub { font-size: 13px; color: var(--vr-soft); }

/* ── Buttons ── */
#imt-viewer-root .imtv-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px;
  border-radius: 9px; border: 1.5px solid transparent; font-size: 13.5px;
  font-weight: 600; cursor: pointer; transition: all .15s; text-decoration: none;
}
#imt-viewer-root .imtv-btn--primary {
  background: var(--vr-primary); color: #fff; border-color: var(--vr-primary);
}
#imt-viewer-root .imtv-btn--primary:hover { opacity: .88; }
#imt-viewer-root .imtv-btn--outline {
  background: #fff; color: var(--vr-ink); border-color: var(--vr-line);
}
#imt-viewer-root .imtv-btn--outline:hover { border-color: #bbb; background: #f9f9f9; }

/* ── Loading ── */
#imt-viewer-root .imtv-loading {
  display: flex; align-items: center; gap: 12px; justify-content: center;
  padding: 48px 24px; color: var(--vr-soft); font-size: 15px;
}

/* ── Header ── */
#imt-viewer-root .imtv-hdr {
  display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap;
  background: var(--vr-card); border: 1px solid var(--vr-line);
  border-radius: var(--vr-radius); padding: 20px; margin-bottom: 14px;
}
#imt-viewer-root .imtv-thumb {
  width: 72px; height: 72px; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--vr-line); flex: none; background: #f5f5f5;
}
#imt-viewer-root .imtv-hdr-info { flex: 1; min-width: 0; }
#imt-viewer-root .imtv-hdr-name {
  font-size: 16px; font-weight: 650; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px;
}
#imt-viewer-root .imtv-hdr-meta { font-size: 13px; color: var(--vr-soft); margin-bottom: 6px; }
#imt-viewer-root .imtv-hdr-count {
  display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px;
  background: #e7f4ec; color: var(--vr-ok); border-radius: 20px;
}
#imt-viewer-root .imtv-hdr-btns {
  display: flex; gap: 8px; flex-wrap: wrap; flex: none; align-items: flex-start;
}

/* ── Sections ── */
#imt-viewer-root .imtv-sections { display: flex; flex-direction: column; gap: 10px; }
#imt-viewer-root .imtv-sec {
  background: var(--vr-card); border: 1px solid var(--vr-line);
  border-radius: var(--vr-radius); overflow: hidden;
}
#imt-viewer-root .imtv-sec-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 650; color: var(--vr-ink); text-align: left;
  transition: background .15s;
}
#imt-viewer-root .imtv-sec-head:hover { background: #fafaf8; }
#imt-viewer-root .imtv-sec-icon { font-size: 16px; flex: none; }
#imt-viewer-root .imtv-sec-title { flex: 1; }
#imt-viewer-root .imtv-sec-count {
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
  background: var(--vr-bg); color: var(--vr-soft); flex: none;
}
#imt-viewer-root .imtv-chevron { font-size: 12px; color: var(--vr-mute); transition: transform .2s; flex: none; }
#imt-viewer-root .imtv-sec-head--collapsed .imtv-chevron { transform: rotate(-90deg); }
#imt-viewer-root .imtv-sec-body {
  border-top: 1px solid var(--vr-line); padding: 4px 0 8px;
}

/* ── Rows ── */
#imt-viewer-root .imtv-row {
  display: flex; align-items: baseline; gap: 12px; padding: 7px 18px;
  border-bottom: 1px solid #f5f4f1;
}
#imt-viewer-root .imtv-row:last-child { border-bottom: none; }
#imt-viewer-root .imtv-row-lbl {
  font-size: 11.5px; font-weight: 600; color: var(--vr-mute); letter-spacing: .02em;
  min-width: 160px; flex: none;
}
#imt-viewer-root .imtv-row-val {
  font-size: 13.5px; color: var(--vr-ink); word-break: break-word; flex: 1;
}

/* ── GPS links ── */
#imt-viewer-root .imtv-gps-links {
  display: flex; gap: 10px; padding: 10px 18px 8px; flex-wrap: wrap;
}
#imt-viewer-root .imtv-gps-link {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px;
  font-weight: 600; color: var(--vr-primary); text-decoration: none;
  padding: 6px 12px; border: 1.5px solid var(--vr-primary);
  border-radius: 8px; transition: background .15s;
}
#imt-viewer-root .imtv-gps-link:hover { background: #f0f1fe; }

/* ── Empty state ── */
#imt-viewer-root .imtv-empty {
  text-align: center; padding: 48px 24px; color: var(--vr-soft);
  background: var(--vr-card); border: 1px solid var(--vr-line);
  border-radius: var(--vr-radius);
}

/* ── Spinner (reuse from main tool) ── */
#imt-viewer-root .imtv-spin {
  display: inline-block; width: 18px; height: 18px;
  border: 2.5px solid #ddd; border-top-color: var(--vr-primary);
  border-radius: 50%; animation: imt-spin .7s linear infinite;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  #imt-viewer-root .imtv-hdr { gap: 12px; }
  #imt-viewer-root .imtv-thumb { width: 54px; height: 54px; }
  #imt-viewer-root .imtv-hdr-btns { width: 100%; }
  #imt-viewer-root .imtv-btn { flex: 1; justify-content: center; }
  #imt-viewer-root .imtv-row { flex-direction: column; gap: 2px; }
  #imt-viewer-root .imtv-row-lbl { min-width: unset; }
  #imt-viewer-root .imtv-drop-inner { padding: 36px 16px; }
  #imt-viewer-root .imtv-drop-title { font-size: 15px; }
}
