:root {
  --gap: 1rem;
  --accent: #2f80ed;
  font-family: system-ui, -apple-system, sans-serif;
}
body {
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  gap: var(--gap);
  background: #f5f5f5;
}
header {
  padding: var(--gap);
  background: var(--accent);
  color: #fff;
  text-align: center;
  font-size: 1.2rem;
}
main {
  display: grid;
  grid-template-columns: 340px 1fr 380px;
  gap: var(--gap);
  padding: 0 var(--gap) var(--gap);
}
main.debug-hidden {
grid-template-columns: 340px 1fr;
}
.panel {
  background: #fff;
  border-radius: 1rem;
  padding: var(--gap);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}
input, textarea, select, button {
  width: 100%;
  padding: 0.6rem 0.8rem;
  margin-bottom: var(--gap);
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
}
textarea {
  resize: vertical;
}
button {
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
button:hover:not([disabled]) {
  background: #1c63c4;
}
button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
#gallery {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  overflow-y: auto;
}
.out-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gap);
}
.img-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.img-card img {
  width: 100%;
  border-radius: 0.75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  cursor: pointer;
}
.meta {
  font-size: 0.8rem;
  color: #555;
  margin-top: 0.25rem;
  text-align: center;
}
#previewWrap img {
  max-width: 320px;
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.zoom-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.5rem;
  width: 100%;
}
.zoom-wrap input {
  width: 90%;
}
pre {
  background: #f0f0f0;
  padding: 0.6rem 0.8rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-size: 0.8rem;
}
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
#lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}