/* EXIF Inspector — three-column report layout plus the metadata tables and
   finding cards, which have no equivalent in media-tools.css. */

.exif-drop { min-height: 232px; }
.exif-drop.is-compact { min-height: 132px; padding: 16px; }
.exif-drop.is-compact .drop-icon { width: 52px; height: 52px; margin-bottom: 13px; border-radius: 16px; }
.exif-drop.is-compact .drop-icon svg { width: 23px; height: 23px; }
.exif-drop.is-compact h2 { font-size: 1rem; }
.exif-drop.is-compact .exif-drop-copy { display: none; }
.exif-drop.is-compact .btn { margin-top: 12px; }

.exif-layout {
  display: grid;
  grid-template-columns: 262px minmax(0, 1fr) 302px;
  gap: 16px;
  align-items: start;
  margin-top: 18px;
}

.exif-files-card,
.exif-side { position: sticky; top: 78px; }
.exif-files-card .file-list { max-height: 61vh; overflow-y: auto; }
.exif-report-card { min-width: 0; }
.exif-side h2 { margin: 0 0 8px; font-size: .95rem; letter-spacing: -.025em; }
.exif-side-note { margin: 0; color: #7c7870; font-size: .68rem; line-height: 1.5; }

/* File rows: the whole row selects, the trailing icon button removes. */
.exif-file { grid-template-columns: minmax(0, 1fr) auto; padding: 6px 6px 6px 8px; cursor: default; }
.exif-file.is-selected { border-color: var(--media-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--media-accent) 10%, transparent); }
.exif-file-pick {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 4px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.exif-file-copy { min-width: 0; }
.exif-file .file-name,
.exif-file .file-meta { display: block; }

.exif-state {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ece7de;
  color: #6c685f;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: .54rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.exif-state.is-working { background: var(--media-soft); color: var(--media-accent-dark); }
.exif-state.is-done { background: #dcefe3; color: #1f6a41; }
.exif-state.is-error { background: #f6dedb; color: #a33c2d; }

.exif-placeholder { padding: 54px 18px; color: #837e75; font-size: .74rem; line-height: 1.6; text-align: center; }
.exif-placeholder-title { margin: 0 0 6px; color: var(--media-ink); font-size: .9rem; font-weight: 750; }
.exif-placeholder p { margin: 0 auto; max-width: 380px; }

.exif-notice { padding: 14px 15px; border: 1px solid var(--media-line); border-radius: 13px; background: rgba(255, 253, 248, .8); }
.exif-notice + * { margin-top: 14px; }
.exif-notice-title { margin: 0; font-size: .78rem; font-weight: 750; }
.exif-notice-text { margin: 5px 0 0; color: #78746c; font-size: .69rem; line-height: 1.55; }
.exif-notice.is-clean { border-color: #bcd9c7; background: #eef7f1; }
.exif-notice.is-clean .exif-notice-title { color: #1f6a41; }
.exif-notice.is-error { border-color: #e3bdb6; background: #fbeeec; }
.exif-notice.is-error .exif-notice-title { color: #a33c2d; }

.exif-report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.exif-report-id { min-width: 0; }
.exif-report-head h2 { overflow: hidden; margin: 0; font-size: 1.02rem; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.exif-report-meta { margin: 4px 0 0; color: #858077; font-family: "DM Mono", ui-monospace, monospace; font-size: .63rem; }
.exif-report-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.exif-report-actions .btn { min-height: 34px; font-size: .66rem; }

.exif-block-title {
  margin: 24px 0 8px;
  color: #56534d;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: .63rem;
  font-weight: 600;
  letter-spacing: .085em;
  text-transform: uppercase;
}
.exif-block-note { margin: 0 0 10px; color: #7c7870; font-size: .68rem; line-height: 1.55; }

.exif-findings { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 8px; }
.exif-finding { padding: 11px 12px; border: 1px solid var(--media-line); border-left-width: 3px; border-radius: 12px; background: #fffdf8; }
.exif-finding-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.exif-finding-title { margin: 0; font-size: .71rem; font-weight: 750; }
.exif-finding-tag { flex: 0 0 auto; font-family: "DM Mono", ui-monospace, monospace; font-size: .53rem; letter-spacing: .06em; text-transform: uppercase; }
.exif-finding-value { overflow-wrap: anywhere; margin: 6px 0 0; color: #55524c; font-size: .68rem; line-height: 1.45; }
.exif-finding.is-high { border-left-color: #b0463a; background: #fdf3f1; }
.exif-finding.is-high .exif-finding-tag { color: #b0463a; }
.exif-finding.is-medium { border-left-color: #a67c00; background: #fdf7e9; }
.exif-finding.is-medium .exif-finding-tag { color: #8c6900; }
.exif-finding.is-low { border-left-color: #7b776e; background: #f7f4ef; }
.exif-finding.is-low .exif-finding-tag { color: #6f6b62; }
.exif-finding.is-clear { border-left-color: #9ec4ad; }
.exif-finding.is-clear .exif-finding-tag { color: #2d7a52; }
.exif-finding.is-clear .exif-finding-value { color: #858077; }
/* No GPS in a copy a phone's photo picker produced: not a clear result. */
.exif-finding.is-unknown { border-left-color: #c9a646; }
.exif-finding.is-unknown .exif-finding-tag { color: #8c6900; }
.exif-picker-note { margin: 10px 0 0; }

.exif-gps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 11px; }
.exif-gps-label { display: block; color: #858077; font-size: .6rem; letter-spacing: .05em; text-transform: uppercase; }
.exif-gps-value { overflow-wrap: anywhere; margin: 4px 0 0; font-family: "DM Mono", ui-monospace, monospace; font-size: .76rem; }
.exif-gps-link { width: 100%; margin-bottom: 10px; border-color: color-mix(in srgb, var(--media-accent) 40%, var(--media-line)); color: var(--media-accent-dark); text-align: center; text-decoration: none; }

.exif-thumb-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.exif-thumb-figure { margin: 0; }
.exif-thumb-figure img { display: block; max-width: 190px; max-height: 150px; border: 1px solid var(--media-line); border-radius: 10px; background: #e7e2d9; }
.exif-thumb-figure figcaption { margin-top: 6px; color: #858077; font-family: "DM Mono", ui-monospace, monospace; font-size: .58rem; }

.exif-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; margin: 0; }
.exif-facts > div { min-width: 0; padding: 9px 11px; border: 1px solid var(--media-line); border-radius: 11px; background: rgba(255, 253, 248, .72); }
.exif-facts dt { color: #858077; font-size: .59rem; letter-spacing: .05em; text-transform: uppercase; }
.exif-facts dd { overflow-wrap: anywhere; margin: 4px 0 0; font-size: .73rem; font-weight: 650; }

.exif-section { margin-bottom: 8px; border: 1px solid var(--media-line); border-radius: 13px; background: rgba(255, 253, 248, .72); }
.exif-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; cursor: pointer; font-size: .76rem; font-weight: 750; list-style: none; }
.exif-section > summary::-webkit-details-marker { display: none; }
.exif-section > summary::after { content: "+"; color: #8b867d; font-family: "DM Mono", ui-monospace, monospace; font-weight: 500; }
.exif-section[open] > summary::after { content: "–"; }
.exif-section-count { margin-left: auto; color: #8b867d; font-family: "DM Mono", ui-monospace, monospace; font-size: .6rem; font-weight: 500; }
.exif-section-body { padding: 0 13px 13px; }
.exif-raw-toggle { min-height: 28px; margin-bottom: 9px; padding: 0 9px; border-radius: 8px; font-size: .61rem; }

.exif-table { width: 100%; border-collapse: collapse; font-size: .7rem; table-layout: fixed; }
.exif-table th, .exif-table td { padding: 6px 8px; border-bottom: 1px solid #ece7de; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.exif-table tr:last-child th, .exif-table tr:last-child td { border-bottom: 0; }
.exif-table th { width: 40%; color: #67635c; font-weight: 650; }
.exif-table td { color: #2c2b28; }
.exif-table.is-raw td, .exif-table.is-raw th { font-family: "DM Mono", ui-monospace, monospace; font-size: .65rem; }
.exif-table-scroll { overflow-x: auto; }

.exif-diff { display: grid; gap: 6px; }
.exif-diff-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 10px; border: 1px solid var(--media-line); border-radius: 10px; background: #fffdf8; }
.exif-diff-row span { color: #7c7870; font-size: .62rem; }
.exif-diff-row strong { font-family: "DM Mono", ui-monospace, monospace; font-size: .68rem; text-align: right; }
.exif-verify { margin: 9px 0 0; padding: 9px 10px; border-radius: 10px; background: #eef7f1; color: #1f6a41; font-size: .65rem; line-height: 1.5; }
.exif-verify.is-warn { background: #fdf7e9; color: #8c6900; }

.exif-modal { position: fixed; inset: 0; z-index: 999; display: grid; place-items: center; padding: 20px; background: rgba(38, 34, 28, .42); backdrop-filter: blur(3px); }
.exif-modal-card { width: min(400px, 100%); padding: 20px; border: 1px solid var(--media-line); border-radius: 17px; background: #fffdf8; box-shadow: 0 24px 60px rgba(40, 34, 26, .22); }
.exif-modal-card h2 { margin: 0 0 8px; font-size: 1rem; letter-spacing: -.025em; }
.exif-modal-card p { margin: 0 0 16px; color: #78746c; font-size: .72rem; line-height: 1.55; }
.exif-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.exif-actionbar { display: none; }

@media (max-width: 1180px) {
  .exif-layout { grid-template-columns: 236px minmax(0, 1fr); }
  .exif-side { position: static; grid-column: 1 / -1; }
}

@media (max-width: 840px) {
  .exif-layout { grid-template-columns: 1fr; }
  .exif-files-card { position: static; }
  .exif-files-card .file-list { max-height: 300px; }

  /* In one column the sidebar's actions come after the entire report, so the
     one that matters next rides along the bottom edge. */
  .exif-actionbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    border-top: 1px solid var(--media-line);
    background: rgba(255, 253, 248, .94);
    box-shadow: 0 -10px 30px rgba(48, 42, 31, .08);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .exif-actionbar .btn { flex: 1 1 auto; min-height: 46px; }
  .exif-has-actionbar .media-shell { padding-bottom: 96px; }
}

/* The label wraps its checkbox, so the whole row already toggles it; on a
   touch screen the row is made finger-tall and the box itself bigger. It is the
   section's first label, which media-tools.css turns into a block, hence the
   extra class in the selector to put flex centring back. */
@media (pointer: coarse) {
  .exif-side .control-section > .inline-check { display: flex; align-items: center; min-height: 44px; }
  .exif-side .inline-check input { width: 20px; height: 20px; margin: 0; }
}

@media (max-width: 540px) {
  .exif-report-actions { width: 100%; }
  .exif-report-actions .btn { flex: 1; }
  .exif-thumb-row { grid-template-columns: 1fr; }
  .exif-thumb-figure img { max-width: 100%; }
}
