[hidden] { display: none !important; }

.tool {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(860px, 100% - 2.5rem);
  padding: 40px 0 72px;
}

.tool h1 {
  color: var(--text-primary);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
  text-align: center;
}

.lead {
  margin-top: 12px;
  text-align: center;
}

/* Drop zone */
.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  padding: 44px 20px;
  background: transparent;
  border: 1px dashed var(--border-muted);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.drop:hover,
.drop.over {
  border-color: var(--text-primary);
  background: var(--bg-surface);
}

.drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.drop:has(input:focus-visible) { outline: 2px solid var(--text-primary); outline-offset: 3px; }
.drop-title { color: var(--text-primary); font-size: 1.05rem; }
.drop-sub { color: var(--text-muted); font-size: 0.8rem; }

.msg { min-height: 1.4em; margin-top: 12px; color: var(--error); font-size: 0.85rem; text-align: center; }

/* Result */
#result { margin-top: 28px; animation: rise 0.45s var(--ease) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.file {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.file img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

.file h2 {
  color: var(--text-primary);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.file p { color: var(--text-muted); font-size: 0.8rem; }

.banner {
  margin-top: 20px;
  text-align: center;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-left: 3px solid var(--success);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 0.88rem;
}

.banner.alert { border-left-color: var(--error); }
.banner.notice { border-left-color: var(--warning); }

/* Metadata grid */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.mcard {
  padding: 16px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.mcard.hot { border-color: var(--error); }

.mcard h3 {
  margin-bottom: 8px;
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 400;
}

.mrow {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--bg-secondary);
  font-size: 0.85rem;
}

.mrow dt { color: var(--text-muted); }
.mrow dd { color: var(--text-primary); overflow-wrap: anywhere; }
.mrow.flag dd { color: var(--warning); }

/* Edit form */
.edit {
  margin-top: 20px;
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.edit h3 { color: var(--text-light); font-size: 0.85rem; font-weight: 400; }
.edit-hint { margin-top: 6px; color: var(--text-muted); font-size: 0.78rem; }

.edit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 16px 0;
}

@media (min-width: 720px) {
  .edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.ef span { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 0.78rem; }

.ef input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.88rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ef input:hover { border-color: var(--border-muted); }

.ef input:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(95, 255, 191, 0.12);
}

.edit .msg { margin: 0 0 12px; text-align: left; }

/* Actions */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.btn-solid:hover { transform: translateY(-2px); }
.done { min-height: 1.4em; margin-top: 14px; color: var(--success); font-size: 0.85rem; text-align: center; }

/* File type badge, for files that have no picture */
.badge {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Smaller drop zone once a file is open */
.drop.compact { margin-top: 20px; padding: 16px 20px; }
.drop.compact .drop-sub { display: none; }
.drop.compact .drop-title { color: var(--text-light); font-size: 0.9rem; }

/* An odd last card fills the row instead of leaving a gap */
.mcard:last-child:nth-child(odd) { grid-column: 1 / -1; }

@media (max-width: 480px) {
  .mrow { grid-template-columns: 1fr; gap: 0; }
  .actions .btn { flex: 1 1 100%; }
}

/* Embedded thumbnail card */
.mcard.thumb { margin-top: 16px; text-align: center; }

.mcard.thumb img {
  max-width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-primary);
}

.mcard.thumb p { margin-top: 10px; color: var(--text-muted); font-size: 0.78rem; }
.mcard.thumb .btn { margin-top: 14px; font-size: 0.85rem; }

/* Raw XMP viewer */
.mcard.raw { margin-top: 16px; }
.mcard.raw summary { color: var(--text-light); font-size: 0.85rem; cursor: pointer; user-select: none; }
.mcard.raw summary:hover { color: var(--text-primary); }

.mcard.raw pre {
  max-height: 340px;
  margin: 12px 0 0;
  padding: 14px 16px;
  overflow: auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-light);
  font: inherit;
  font-size: 0.74rem;
  line-height: 1.65;
  white-space: pre;
  tab-size: 2;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: var(--border-muted) transparent;
}

.mcard.raw pre::-webkit-scrollbar { width: 8px; height: 8px; }
.mcard.raw pre::-webkit-scrollbar-track { background: transparent; }
.mcard.raw pre::-webkit-scrollbar-thumb { background: var(--border-muted); border-radius: 4px; }
.mcard.raw pre::-webkit-scrollbar-corner { background: transparent; }

/* Raw XMP colors: tags quiet, names and values stand out */
.x-tag { color: var(--text-muted); }
.x-attr { color: var(--text-light); }
.x-val { color: var(--text-primary); }
.x-text { color: var(--text-primary); }

/* Copy buttons */
.mhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.mhead h3 { margin: 0; }

.copy {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 0.72rem;
  cursor: pointer;
  min-width: 4.6em;
  text-align: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.copy:hover { border-color: var(--text-primary); color: var(--text-primary); }

/* Copy feedback: just the text and a color change, no movement, glow or size change */
.copied,
.copied::before,
.copied::after {
  animation: none !important;
  transform: none !important;
  box-shadow: none !important;
  transition: color 0.15s ease, border-color 0.15s ease !important;
}

.copy.copied,
#copyAll.copied { border-color: var(--success); color: var(--success); }
#copyAll { min-width: 9em; }
.mcard.raw summary .copy { float: right; }

/* Risk summary, and the plain-language notes under each row */
.banner strong { color: var(--text-primary); font-weight: 700; }
.bar { display: flex; justify-content: flex-end; margin-top: 12px; }
#explain { min-width: 10em; }
.mact { display: flex; align-items: center; gap: 8px; }
.why { display: none; margin-top: 3px; color: var(--text-muted); font-size: 0.74rem; line-height: 1.45; }
.cards.explain .why { display: block; }

/* Investigator tools: hidden until opened */
.adv { display: flex; align-items: center; gap: 16px; margin-top: 28px; }
.adv::before, .adv::after { content: ""; flex: 1; height: 1px; background: var(--border-color); }

.adv button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: 999px;
  color: var(--text-light);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease);
}

.adv button svg { width: 16px; height: 16px; flex: none; }
.adv .chev { transition: transform 0.3s var(--ease); }

.adv button:hover {
  border-color: var(--text-primary);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.adv button[aria-expanded="true"] { border-color: var(--text-primary); color: var(--text-primary); }
.adv button[aria-expanded="true"] .chev { transform: rotate(180deg); }

@media (prefers-reduced-motion: reduce) {
  .adv button:hover { transform: none; }
}

.osint { display: grid; gap: 16px; margin-top: 18px; animation: rise 0.35s var(--ease) both; }
.osint .actions { margin-top: 0; }
.osint .mrow dd { font-size: 0.8rem; }
.osint .mrow dd small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 0.72rem; }
.osint dl { margin: 0; }

.checks { margin: 12px 0 0; padding: 0; list-style: none; }

.checks li {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-left: 3px solid var(--warning);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 0.8rem;
}

.checks li.ok { border-left-color: var(--success); }

.tagcount { margin-left: 6px; color: var(--text-muted); }
.mcard.raw summary + .tagfilter { margin-top: 12px; }

.tagfilter {
  display: block;
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.82rem;
}

.tagfilter:focus { outline: none; border-color: var(--text-primary); box-shadow: 0 0 0 3px rgba(95, 255, 191, 0.12); }

.tagtable {
  max-height: 380px;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  scrollbar-width: thin;
  scrollbar-color: var(--border-muted) transparent;
}

.trow {
  display: grid;
  grid-template-columns: minmax(110px, 190px) minmax(0, 1fr);
  gap: 12px;
  padding: 7px 12px;
  border-top: 1px solid var(--bg-secondary);
  font-size: 0.78rem;
}

.trow:first-child { border-top: 0; }
.trow .tn { color: var(--text-light); overflow-wrap: anywhere; }
.trow .tn small { display: block; color: var(--text-muted); font-size: 0.7rem; }
.trow .tv { color: var(--text-primary); overflow-wrap: anywhere; white-space: pre-wrap; }
.tagempty { padding: 14px; color: var(--text-muted); font-size: 0.8rem; }