:root {
  --bg: #12100e;
  --panel: #1c1814;
  --line: #3a322a;
  --text: #f2ebe1;
  --muted: #b7aa98;
  --accent: #e0a35a;
  --accent-ink: #1a1208;
  --ok: #7dbe74;
  --danger: #d87b6a;
  --radius: 14px;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, #2a2118 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #1a2428 0%, transparent 50%),
    var(--bg);
  font-family: var(--sans);
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: 1.4rem 1.6rem 1rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--accent);
}
h1 {
  margin: 0.15rem 0 0;
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.8rem;
}
.top-actions { display: flex; gap: 0.6rem; }

button, .file-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
}
button.ghost, .file-btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
button:disabled { opacity: 0.45; cursor: not-allowed; }

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: calc(100vh - 90px);
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 1rem;
  background: color-mix(in srgb, var(--panel) 88%, black);
}
.sidebar h2, .workspace h2 {
  margin: 0 0 0.7rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
#project-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
#project-list button {
  width: 100%;
  text-align: left;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 600;
}
#project-list button.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
#project-list small { display: block; color: var(--muted); font-weight: 500; }

.job-box {
  margin-top: 1.4rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
#job-log {
  margin: 0;
  max-height: 280px;
  overflow: auto;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
  white-space: pre-wrap;
}

.workspace { padding: 1.1rem 1.3rem 2rem; }
.empty { color: var(--muted); }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.2rem;
}
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.thumb {
  aspect-ratio: 16 / 9;
  background: #0a0908;
  display: grid;
  place-items: center;
  color: var(--muted);
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
}
.thumb img, .thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb .zoom-hint {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  font-size: 0.7rem;
  background: rgba(0,0,0,0.55);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  color: var(--text);
  pointer-events: none;
}
.review-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 140px;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0.4rem 0 1rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.review-strip button {
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--line);
  background: #0a0908;
  aspect-ratio: 16 / 9;
}
.review-strip button.active,
.review-strip button:hover {
  border-color: var(--accent);
}
.review-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.review-strip .num {
  position: absolute;
  left: 0.3rem;
  top: 0.3rem;
  font-size: 0.65rem;
  background: rgba(0,0,0,0.65);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}
.review-item { position: relative; }
#lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(1100px, 96vw);
}
#lightbox::backdrop { background: rgba(0,0,0,0.82); }
#lightbox img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}
#lightbox .lb-meta {
  margin-top: 0.6rem;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.card-body { padding: 0.8rem; display: grid; gap: 0.55rem; }
.card-body h3 {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
}
.badges { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.badge {
  font-size: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  color: var(--muted);
}
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
textarea, select, input[type="text"], input[type="file"], dialog input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #100e0c;
  color: var(--text);
  padding: 0.55rem 0.65rem;
  font: inherit;
}
textarea { min-height: 88px; resize: vertical; }
.row { display: flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; }
.row label { display: flex; gap: 0.35rem; align-items: center; color: var(--muted); font-size: 0.85rem; }

dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  padding: 1.2rem;
  width: min(420px, 92vw);
}
dialog::backdrop { background: rgba(0,0,0,0.55); }
dialog label { display: grid; gap: 0.3rem; margin: 0.7rem 0; }
dialog menu { display: flex; justify-content: end; gap: 0.5rem; padding: 0; margin: 1rem 0 0; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
}
