:root {
  color-scheme: light dark;
  --bg: #f4f6f2;
  --surface: #ffffff;
  --surface-2: #edf1ea;
  --line: #d4dbd2;
  --line-soft: #e3e8e1;
  --text: #151917;
  --muted: #657069;
  --accent: #527400;
  --accent-solid: #c8f35a;
  --accent-2: #006b91;
  --warning: #975100;
  --danger: #b3261e;
  --ok: #16784a;
  --glow: rgba(111, 150, 20, 0.12);
  --drop-border: #99a59d;
  --drop-bg: rgba(255, 255, 255, 0.78);
  --drop-hover-bg: rgba(82, 116, 0, 0.07);
  --icon-text: #182000;
  --preview-bg: #e8ede7;
  --decorative-ring: rgba(20, 35, 28, 0.055);
  --subtle-label: #727e77;
  --chart-track: #e5ebe3;
  --chart-end: #87ad20;
  --tag-text: #3d4741;
  --row-hover: rgba(20, 40, 30, 0.035);
  --code-bg: #f0f3ee;
  --code-text: #36413a;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d0c;
    --surface: #111614;
    --surface-2: #171d1a;
    --line: #2b332f;
    --line-soft: #202724;
    --text: #f3f5f2;
    --muted: #98a39d;
    --accent: #d9ff68;
    --accent-solid: #d9ff68;
    --accent-2: #88d8ff;
    --warning: #ffba6b;
    --danger: #ff7d76;
    --ok: #7be0aa;
    --glow: rgba(217, 255, 104, 0.08);
    --drop-border: #56635d;
    --drop-bg: rgba(17, 22, 20, 0.72);
    --drop-hover-bg: rgba(217, 255, 104, 0.06);
    --icon-text: #11160d;
    --preview-bg: #212825;
    --decorative-ring: rgba(255, 255, 255, 0.035);
    --subtle-label: #647069;
    --chart-track: #222a26;
    --chart-end: #a1d832;
    --tag-text: #c5ccc8;
    --row-hover: rgba(255, 255, 255, 0.018);
    --code-bg: #0c100e;
    --code-text: #c9d1cd;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 82% 4%, var(--glow), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

button, input, select { font: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: var(--accent);
}

.brand-mark svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark rect { fill: currentColor; stroke: none; }

main { padding: 68px 0 28px; }

.upload-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(440px, 1.15fr);
  align-items: end;
  gap: 56px;
  padding-bottom: 72px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font: 700 0.75rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 {
  max-width: 550px;
  margin-bottom: 18px;
  font-size: clamp(2.45rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.intro-copy > p:last-child {
  max-width: 570px;
  margin-bottom: 0;
  color: var(--muted);
}

.drop-zone {
  min-height: 244px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 32px;
  border: 1px dashed var(--drop-border);
  border-radius: 18px;
  background: var(--drop-bg);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--drop-hover-bg);
  transform: translateY(-2px);
}

.drop-zone.is-loading { pointer-events: none; opacity: 0.68; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.drop-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--accent-solid);
  color: var(--icon-text);
}

.drop-icon svg,
.search-field svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop-primary { font-weight: 700; font-size: 1.06rem; }
.drop-secondary { color: var(--muted); font-size: 0.8125rem; }

.status-message {
  grid-column: 2;
  min-height: 24px;
  margin-top: -44px;
  color: var(--muted);
  font-size: 0.875rem;
}

.status-message.is-error { color: var(--danger); }
.results { animation: reveal 280ms ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }

.file-strip {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.preview-shell {
  width: 104px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: var(--preview-bg);
  color: var(--accent);
  font: 700 0.8rem ui-monospace, monospace;
  letter-spacing: 0.12em;
}

.preview-shell img { width: 100%; height: 100%; object-fit: cover; display: none; }
.preview-shell.has-preview img { display: block; }
.preview-shell.has-preview span { display: none; }
.file-heading h2 { margin-bottom: 2px; font-size: 1.2rem; overflow-wrap: anywhere; }
.file-heading p:last-child { margin-bottom: 0; color: var(--muted); font-size: 0.875rem; }

.secondary-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.secondary-button:hover { border-color: var(--accent); color: var(--accent); }

.section-block { padding: 66px 0 0; }
.section-heading, .panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.section-heading h2, .panel-heading h2 { margin-bottom: 0; font-size: 1.5rem; letter-spacing: -0.035em; }
.section-stat { margin-bottom: 0; color: var(--muted); font-size: 0.875rem; }

.overview-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
}

.identity-card,
.exposure-card,
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
}

.identity-card { min-height: 250px; padding: 30px; border-radius: 16px; }
.card-label { color: var(--muted); font-size: 0.8125rem; }
.identity-card > strong {
  display: block;
  max-width: 650px;
  margin: 20px 0 5px;
  font-size: clamp(1.65rem, 3vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}
.identity-card > p { color: var(--muted); }
.identity-details { display: flex; flex-wrap: wrap; gap: 34px; margin: 28px 0 0; }
.identity-details div { min-width: 150px; }
.identity-details dt { color: var(--muted); font-size: 0.75rem; }
.identity-details dd { margin: 3px 0 0; font-size: 0.9rem; }

.exposure-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.exposure-card {
  position: relative;
  min-width: 0;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 18px;
  overflow: hidden;
  border-radius: 16px;
}
.exposure-card::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -58px;
  width: 140px;
  height: 140px;
  border: 22px solid var(--decorative-ring);
  border-radius: 50%;
}
.exposure-card span { color: var(--muted); font-size: 0.8125rem; }
.exposure-card strong { position: relative; z-index: 1; font-size: clamp(1.35rem, 2.4vw, 2.2rem); letter-spacing: -0.04em; overflow-wrap: anywhere; }
.exposure-card small { color: var(--subtle-label); font: 700 0.66rem ui-monospace, monospace; letter-spacing: 0.1em; }
.exposure-card.aperture { border-top-color: var(--accent); }
.exposure-card.shutter { border-top-color: var(--accent-2); }
.exposure-card.iso { border-top-color: var(--warning); }
.exposure-card.compensation { border-top-color: var(--danger); }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 66px; }
.panel { min-height: 355px; padding: 28px; border-radius: 16px; }
.privacy-score { padding: 5px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.75rem; }
.privacy-list { display: grid; gap: 10px; }
.privacy-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}
.privacy-item:first-child { border-top: 0; }
.privacy-marker { width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--ok); }
.privacy-item.warn .privacy-marker { background: var(--warning); }
.privacy-item.danger .privacy-marker { background: var(--danger); }
.privacy-item strong { display: block; font-size: 0.9rem; }
.privacy-item p { margin: 2px 0 0; color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }

.summary-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.summary-item { display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.summary-item:nth-child(-n + 2) { border-top: 0; }
.summary-marker { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--muted); }
.summary-item.present .summary-marker, .summary-item.ok .summary-marker { background: var(--ok); }
.summary-item.warn .summary-marker { background: var(--warning); }
.summary-item strong { display: block; font-size: 0.84rem; }
.summary-item p { margin: 2px 0 0; color: var(--muted); font-size: 0.75rem; }

.insight-grid,
.pixel-grid,
.fingerprint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.core-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.insight-card {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.insight-card[hidden] { display: none; }
.insight-card.span-2 { grid-column: span 2; }
.insight-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.insight-heading span { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.insight-heading small { color: var(--muted); font: 700 0.64rem ui-monospace, monospace; letter-spacing: 0.1em; }
.insight-value { display: block; margin-bottom: 20px; font-size: clamp(1.9rem, 4vw, 3.2rem); line-height: 1; letter-spacing: -0.055em; }
.insight-note, .analysis-status { margin: 15px 0 0; color: var(--muted); font-size: 0.78rem; }

.fact-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fact, .fact-list > div { min-width: 0; }
.fact {
  padding: 14px;
  border-radius: 11px;
  background: var(--surface-2);
}
.fact span, .fact-list dt { display: block; color: var(--muted); font-size: 0.7rem; }
.fact strong { display: block; margin-top: 5px; overflow-wrap: anywhere; font-size: 0.9rem; }
.fact-list { display: grid; gap: 13px; margin: 0; }
.fact-list.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fact-list dd { margin: 2px 0 0; overflow-wrap: anywhere; font-size: 0.86rem; font-weight: 600; }
.visibility-value { display: flex; align-items: center; gap: 7px; min-width: 0; }
.visibility-value > :first-child { min-width: 0; overflow-wrap: anywhere; }
.visibility-toggle {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.visibility-toggle:hover { background: var(--surface-2); color: var(--text); }
.visibility-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visibility-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.visibility-toggle .eye-open { display: none; }
.visibility-toggle[aria-pressed="true"] .eye-open { display: block; }
.visibility-toggle[aria-pressed="true"] .eye-closed { display: none; }
.privacy-item .visibility-value { margin-top: 2px; }
.privacy-item .visibility-value p { margin: 0; }

.scale-track {
  position: relative;
  height: 8px;
  margin: 16px 4px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--warning));
}
.scale-track > span, .temperature-track > span {
  position: absolute;
  top: 50%;
  width: 17px;
  height: 17px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 1px var(--line);
  transform: translate(-50%, -50%);
}
.scale-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.66rem; }
.temperature-track { position: relative; height: 11px; margin: 20px 4px 25px; border-radius: 999px; background: linear-gradient(90deg, #6ab8ff, #f3f0d4 52%, #ff9b52); }

.location-layout { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 22px; }
.compass {
  width: 94px;
  height: 94px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: radial-gradient(circle, var(--surface-2) 0 45%, transparent 46%), conic-gradient(from 45deg, var(--line-soft), transparent 15%, var(--line-soft) 25%, transparent 40%, var(--line-soft) 50%, transparent 65%, var(--line-soft) 75%, transparent 90%, var(--line-soft));
}
.compass span { display: block; color: var(--danger); font-size: 2rem; line-height: 1; transform-origin: center; }

.format-visual { width: 160px; height: 106px; display: grid; place-items: center; margin-bottom: 20px; border: 2px solid var(--accent); border-radius: 8px; background: var(--surface-2); }
.format-visual span { color: var(--muted); font: 700 0.72rem ui-monospace, monospace; }
.color-orbit { position: relative; width: 112px; height: 80px; margin: 5px 0 24px; }
.color-orbit i { position: absolute; width: 60px; height: 60px; border-radius: 50%; opacity: 0.72; mix-blend-mode: multiply; }
.color-orbit i:nth-child(1) { left: 4px; top: 0; background: #ff5e66; }
.color-orbit i:nth-child(2) { right: 4px; top: 0; background: #5c8dff; }
.color-orbit i:nth-child(3) { left: 26px; bottom: 0; background: #58d981; }

.adjustment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 30px; }
.adjustment-row { display: grid; grid-template-columns: 106px minmax(0, 1fr) 48px; align-items: center; gap: 12px; }
.adjustment-row label, .adjustment-row output { font-size: 0.75rem; }
.adjustment-row output { color: var(--muted); text-align: right; font-family: ui-monospace, monospace; }
.adjustment-track { position: relative; height: 5px; border-radius: 999px; background: var(--chart-track); }
.adjustment-track::before { content: ""; position: absolute; left: 50%; top: -3px; width: 1px; height: 11px; background: var(--line); }
.adjustment-fill { position: absolute; top: 0; bottom: 0; border-radius: inherit; background: var(--accent); }

.xmp-export-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr); align-items: end; gap: 28px; }
.xmp-export-title { display: block; font-size: 1.05rem; }
.xmp-export-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.xmp-name-field span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 0.7rem; }
.xmp-name-field input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
}
.xmp-name-field input:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.xmp-export-controls .secondary-button:disabled { cursor: not-allowed; opacity: 0.45; }
.xmp-export-warning { margin: 18px 0 0; color: var(--warning); font-size: 0.75rem; }

.crop-stage { position: relative; aspect-ratio: 3 / 2; margin-bottom: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, var(--line) 10px, var(--line) 11px); }
.crop-stage-label { position: absolute; z-index: 2; top: 10px; left: 10px; padding: 3px 7px; border-radius: 5px; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text); font: 700 0.62rem/1.4 ui-monospace, monospace; letter-spacing: 0.08em; }
.crop-frame { position: absolute; border: 2px solid var(--accent); box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.22); }
.crop-frame::before, .crop-frame::after { content: ""; position: absolute; inset: 33.333% 0 auto; border-top: 1px solid rgba(255, 255, 255, 0.55); }
.crop-frame::after { inset: 66.666% 0 auto; }

@media (prefers-color-scheme: dark) {
  .color-orbit i { opacity: 0.82; mix-blend-mode: screen; }
  .crop-stage { background: repeating-linear-gradient(45deg, #18201c, #18201c 10px, #344039 10px, #344039 11px); }
  .crop-frame { box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.12); }
}

.tone-layout { display: grid; grid-template-columns: minmax(260px, 0.8fr) minmax(280px, 1.2fr); gap: 30px; }
.tone-curve { width: 100%; min-height: 190px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(to right, transparent 24.7%, var(--line-soft) 25%, transparent 25.3%, transparent 49.7%, var(--line-soft) 50%, transparent 50.3%, transparent 74.7%, var(--line-soft) 75%, transparent 75.3%), linear-gradient(to bottom, transparent 24.7%, var(--line-soft) 25%, transparent 25.3%, transparent 49.7%, var(--line-soft) 50%, transparent 50.3%, transparent 74.7%, var(--line-soft) 75%, transparent 75.3%); }
.hsl-bars { display: grid; gap: 11px; align-content: center; }
.hsl-row { display: grid; grid-template-columns: 68px minmax(0, 1fr) 42px; align-items: center; gap: 10px; font-size: 0.72rem; }
.hsl-row > span:last-child { color: var(--muted); text-align: right; font-family: ui-monospace, monospace; }
.hsl-track { position: relative; height: 7px; border-radius: 999px; background: var(--chart-track); }
.hsl-track i { position: absolute; top: -2px; width: 3px; height: 11px; border-radius: 3px; background: currentColor; }

.timeline { position: relative; display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 20px 22px; border-left: 1px solid var(--line); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -5px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.timeline-item strong { display: block; font-size: 0.84rem; }
.timeline-item span { color: var(--muted); font-size: 0.75rem; }
.rating { min-height: 28px; margin-bottom: 14px; color: var(--warning); font-size: 1.35rem; letter-spacing: 0.12em; }
.keyword-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.keyword-list span { padding: 4px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.7rem; }
.embedded-preview { aspect-ratio: 3 / 2; overflow: hidden; border-radius: 10px; background: var(--surface-2); }
.embedded-preview img { width: 100%; height: 100%; object-fit: contain; }

.coverage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.coverage-item { padding: 10px 8px; border: 1px solid var(--line-soft); border-radius: 9px; text-align: center; }
.coverage-item.is-present { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); background: color-mix(in srgb, var(--ok) 8%, transparent); }
.coverage-item strong { display: block; font: 700 0.72rem ui-monospace, monospace; }
.coverage-item span { color: var(--muted); font-size: 0.65rem; }
.conflict-list { display: grid; gap: 12px; }
.conflict-item { padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.conflict-item:last-child { padding-bottom: 0; border-bottom: 0; }
.conflict-item strong { display: block; margin-bottom: 3px; font-size: 0.82rem; }
.conflict-item p { margin: 0; color: var(--muted); font-size: 0.72rem; overflow-wrap: anywhere; }
.structure-bar { display: flex; height: 16px; overflow: hidden; border-radius: 999px; background: var(--chart-track); }
.structure-segment { min-width: 2px; height: 100%; }
.structure-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 16px; }
.structure-legend span { color: var(--muted); font-size: 0.7rem; }
.structure-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }

.pixel-card { min-height: 310px; }
#histogram-canvas { width: 100%; height: 210px; display: block; }
.palette { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; min-height: 210px; }
.swatch { min-height: 95px; display: flex; align-items: end; padding: 10px; border-radius: 11px; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.18); }
.swatch span { padding: 3px 6px; border-radius: 5px; background: rgba(0, 0, 0, 0.52); color: #fff; font: 0.66rem ui-monospace, monospace; }

.details-section { padding-bottom: 36px; }
.details-heading { align-items: center; }
.table-tools { display: flex; align-items: center; gap: 10px; }
.details-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.details-toggle:hover { border-color: var(--accent); color: var(--accent); }
.details-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.details-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 160ms ease; }
.details-toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }
.search-field { position: relative; min-width: 260px; }
.search-field svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.group-select { position: relative; min-width: 150px; }
.group-select::after {
  content: "";
  position: absolute;
  right: 15px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
}
.search-field input, .group-select select {
  height: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--surface);
  color: var(--text);
}
.search-field input { width: 100%; padding: 0 14px 0 40px; }
.group-select select {
  width: 100%;
  max-width: 180px;
  padding: 0 38px 0 13px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.search-field input:focus, .group-select select:focus { border-color: var(--accent); }
.group-select:focus-within::after { color: var(--accent); }

.table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
th:first-child, td:first-child { width: 15%; }
th:nth-child(2), td:nth-child(2) { width: 27%; }
td { font-size: 0.875rem; overflow-wrap: anywhere; }
td:first-child { color: var(--accent); font: 0.75rem ui-monospace, monospace; }
td:nth-child(2) { color: var(--tag-text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
tbody tr:hover { background: var(--row-hover); }
tbody tr:last-child td { border-bottom: 0; }
.structured-value summary {
  width: fit-content;
  color: var(--accent-2);
  cursor: pointer;
  font-size: 0.8125rem;
}
.structured-value pre {
  max-height: 320px;
  margin: 10px 0 0;
  padding: 12px;
  overflow: auto;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-text);
  font: 0.75rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}
.empty-filter { padding: 46px 20px; color: var(--muted); text-align: center; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 36px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 860px) {
  .upload-section { grid-template-columns: 1fr; gap: 34px; padding-bottom: 48px; }
  .status-message { grid-column: 1; margin-top: -22px; }
  .overview-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .exposure-card { min-height: 190px; }
  .details-heading { align-items: flex-start; flex-direction: column; }
  .table-tools { width: 100%; }
  .search-field { flex: 1; min-width: 0; }
  .fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tone-layout { grid-template-columns: 1fr; }
  .core-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exposure-card { min-height: 150px; }
}

@media (max-width: 600px) {
  .site-header, main, footer { width: min(100% - 24px, 1180px); }
  .site-header { min-height: 68px; }
  .brand { font-size: 0.9rem; }
  main { padding-top: 44px; }
  h1 { font-size: 2.7rem; }
  .drop-zone { min-height: 220px; padding: 24px 16px; }
  .file-strip { grid-template-columns: 74px minmax(0, 1fr); }
  .preview-shell { width: 74px; }
  .secondary-button { grid-column: 1 / -1; width: 100%; }
  .section-block { padding-top: 48px; }
  .identity-card, .panel { padding: 22px; }
  .exposure-grid { grid-template-columns: 1fr; }
  .exposure-card { min-height: 140px; }
  .table-tools { align-items: stretch; flex-direction: column; }
  .details-toggle { justify-content: center; }
  .group-select, .group-select select { width: 100%; max-width: none; }
  th:first-child, td:first-child { width: 25%; }
  th:nth-child(2), td:nth-child(2) { width: 32%; }
  th, td { padding: 12px 10px; }
  footer { flex-direction: column; gap: 5px; }
  .insight-grid, .pixel-grid, .fingerprint-grid, .core-detail-grid { grid-template-columns: 1fr; }
  .insight-card.span-2 { grid-column: auto; }
  .insight-card { padding: 21px; }
  .fact-grid, .adjustment-grid { grid-template-columns: 1fr; }
  .adjustment-row { grid-template-columns: 94px minmax(0, 1fr) 42px; }
  .xmp-export-layout, .xmp-export-controls { grid-template-columns: 1fr; }
  .xmp-export-controls .secondary-button { width: 100%; }
  .location-layout { grid-template-columns: 76px minmax(0, 1fr); gap: 16px; }
  .compass { width: 74px; height: 74px; }
  .palette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-list { grid-template-columns: 1fr; }
  .summary-item:nth-child(2) { border-top: 1px solid var(--line-soft); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
