:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --ink: #23211e;
  --muted: #8a857c;
  --line: #e5e2db;
  --accent: #1f4f46;
  --accent-soft: #e5efec;
  --warn: #a4574a;
  --radius: 10px;
  font-size: 15px;
}
* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

.topbar {
  display: flex; align-items: center; gap: 28px;
  padding: 14px 26px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; letter-spacing: 0.02em; }
.topbar nav { display: flex; gap: 18px; }
.topbar nav a {
  color: var(--muted); text-decoration: none; font-weight: 500;
  padding: 4px 2px; border-bottom: 2px solid transparent;
}
.topbar nav a.active { color: var(--ink); border-bottom-color: var(--accent); }
.whoami { margin-left: auto; color: var(--muted); font-size: 0.86rem; }

main { padding: 24px 26px 80px; max-width: 1280px; margin: 0 auto; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; align-items: center; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 5px 14px; cursor: pointer; font-size: 0.86rem;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.filters input[type="search"] {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  min-width: 220px; background: var(--card); font-size: 0.9rem;
}

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: box-shadow 0.12s;
}
.card:hover { box-shadow: 0 3px 14px rgba(0,0,0,0.09); }
.card .thumb {
  aspect-ratio: 1; background:
    repeating-conic-gradient(#eceae5 0% 25%, #f6f5f2 0% 50%) 0 0/22px 22px;
  display: grid; place-items: center; overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.card .meta { padding: 10px 12px; }
.card .meta .name { font-weight: 600; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta .sub { display: flex; gap: 6px; margin-top: 6px; align-items: center; }

.badge {
  font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; font-weight: 600;
  background: #eee; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.badge.approved { background: var(--accent-soft); color: var(--accent); }
.badge.awaiting_review { background: #fdf1dc; color: #8a6a1f; }
.badge.processing { background: #e8ecf4; color: #4a5a7a; }
.badge.src-human { background: var(--accent-soft); color: var(--accent); }
.badge.src-shoot_log { background: #e4ecf7; color: #2f5d8a; }
.badge.src-estimated { background: #efedea; color: var(--muted); }

.empty { color: var(--muted); padding: 60px 0; text-align: center; }

.detail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); gap: 26px; }
.detail .imagery img {
  width: 100%; border-radius: var(--radius); border: 1px solid var(--line);
  background: repeating-conic-gradient(#eceae5 0% 25%, #f6f5f2 0% 50%) 0 0/22px 22px;
}
.detail .imagery .row { display: flex; gap: 10px; margin-top: 10px; }
.detail .imagery .row img { width: 120px; }
.panel-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px;
}
.panel-card h2 { font-size: 0.95rem; margin-bottom: 12px; }
.field { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; align-items: center; margin-bottom: 9px; }
.field label { color: var(--muted); font-size: 0.84rem; }
.field input, .field select {
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px;
  font-size: 0.9rem; width: 100%; background: #fff;
}
.actions { display: flex; gap: 10px; margin-top: 14px; }
button {
  border: 0; border-radius: 8px; padding: 9px 18px; font-weight: 600;
  cursor: pointer; background: var(--accent); color: #fff; font-size: 0.9rem;
}
button.secondary { background: #efedea; color: var(--ink); }
button.danger { background: var(--warn); }
button:disabled { opacity: 0.5; cursor: default; }

.review-stage { max-width: 900px; margin: 0 auto; text-align: center; }
.review-stage .progress { color: var(--muted); margin-bottom: 14px; }
.review-stage img.hero {
  max-width: 100%; max-height: 56vh; border-radius: var(--radius);
  border: 1px solid var(--line);
}
.review-stage .facts {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0;
}
.review-stage .keys { color: var(--muted); font-size: 0.84rem; margin-top: 18px; }
.review-stage .keys kbd {
  background: var(--card); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 7px; font-family: inherit;
}

.overlay {
  position: fixed; inset: 0; background: rgba(40, 38, 34, 0.55);
  display: grid; place-items: center; z-index: 50;
}
.overlay .panel {
  background: var(--card); border-radius: 14px; padding: 38px 44px;
  text-align: center; max-width: 380px;
}
.overlay .panel h1 { font-size: 1.2rem; margin-bottom: 10px; }
.overlay .panel p { color: var(--muted); margin-bottom: 20px; line-height: 1.5; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 10px 22px; font-size: 0.9rem; z-index: 60;
}
.hidden { display: none; }
