:root {
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --surface-alt: #252525;
  --text: #e0e0e0;
  --text-muted: #9a9a9a;
  --accent: #4f8cff;
  --radius: 6px;
  --t: 0.25s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100dvh;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
}

#toggleSidebar {
  position: fixed;
  top: 0.8rem;
  left: 0.9rem;
  z-index: 1200;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--surface-alt);
  border-radius: var(--radius);
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  transition: var(--t);
}
#toggleSidebar:hover {
  filter: brightness(1.1);
}
#toggleSidebar.open {
  left: calc(260px - 45px);
}

#sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  background: var(--surface);
  padding: 1.4rem 1rem;
  border-right: 1px solid var(--surface-alt);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: var(--t);
  z-index: 1100;
}
#sidebar.open {
  transform: translateX(0);
}

#sidebar h2 {
  margin: 0 0 2rem 0;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#sidebar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#sidebar li {
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--t);
}
#sidebar li:hover,
#sidebar li.active {
  background: var(--surface-alt);
}

.new-batch {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  margin-bottom: 0.6rem;
}
.new-batch:hover {
  filter: brightness(1.1);
}

#sidebar li .time {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

#main {
  flex: 1;
  padding: 4.5rem 3rem 2rem;
  overflow-y: auto;
}

h1 {
  margin-top: 0;
  font-size: 1.8rem;
}

.field {
  margin-bottom: 1.6rem;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

textarea,
input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--surface-alt);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  resize: vertical;
  transition: var(--t);
}
textarea:focus,
input:focus {
  outline: none;
  border-color: var(--accent);
}

button#generate {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--t);
}
button#generate:hover {
  filter: brightness(1.1);
}

#status {
  margin: 1rem 0;
  min-height: 1.2rem;
  color: var(--accent);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
}
.image-grid img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
}

.score {
  margin-top: -0.6rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  #main {
    padding: 3.6rem 1.25rem 2rem;
  }
  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}
