* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #f2f2f2;
  color: #111;
}

.center-box {
  max-width: 420px;
  margin: 10vh auto;
  padding: 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

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

form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

input {
  font-size: 1rem;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

button {
  font-size: 1rem;
  padding: 12px;
  border: none;
  border-radius: 6px;
  background: #1a73e8;
  color: #fff;
  cursor: pointer;
}

button:active {
  background: #135cbb;
}

.error {
  color: #c0392b;
  font-size: 0.9rem;
}

.error:empty { display: none; }

.error.box {
  background: #fdecea;
  padding: 12px;
  border-radius: 6px;
}

select, textarea {
  font-size: 1rem;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
}

.wide {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.generator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.col-uploads, .col-params {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.checkbox input { width: auto; }

.preview img.thumb {
  max-width: 100%;
  max-height: 220px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.note {
  font-size: 0.85rem;
  color: #555;
  background: #f0f4ff;
  padding: 8px 10px;
  border-radius: 6px;
}

.warning {
  font-size: 0.9rem;
  color: #8a5a00;
  background: #fff3cd;
  padding: 10px;
  border-radius: 6px;
}

.cost-box {
  font-weight: bold;
  font-size: 1.05rem;
  padding: 10px;
  background: #eef6ff;
  border-radius: 6px;
}

.box {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.result-media, .gallery-media {
  max-width: 100%;
  max-height: 400px;
  display: block;
  margin: 12px 0;
  border-radius: 6px;
}

.download-link {
  display: inline-block;
  margin-bottom: 12px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.gallery-card {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.gallery-meta {
  font-size: 0.8rem;
  color: #666;
  margin: 0 0 4px;
}

.gallery-status {
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.status-completed { color: #1a7a1a; }
.status-failed { color: #c0392b; }
.status-processing, .status-queued { color: #8a5a00; }

.gallery-cost {
  font-size: 0.85rem;
  color: #333;
}

@media (max-width: 900px) {
  .generator-grid {
    grid-template-columns: 1fr;
  }
}

.modes {
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
}

.presets {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.preset-btn {
  background: #e8eefc;
  color: #1a73e8;
  padding: 8px 12px;
  font-size: 0.85rem;
  flex: 1;
}

.preset-btn:hover {
  background: #d5e2fb;
}

.file-group {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
}

.file-group h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.numbered-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.numbered-preview .item {
  text-align: center;
  font-size: 0.75rem;
}

.numbered-preview img, .numbered-preview video {
  max-width: 100px;
  max-height: 100px;
  display: block;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.tag-hint {
  font-size: 0.85rem;
  color: #555;
  background: #f5f5f5;
  padding: 8px 10px;
  border-radius: 6px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.admin-table th, .admin-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
}

.admin-table th {
  background: #f5f5f5;
  font-size: 0.85rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.dashboard-card {
  display: block;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: inherit;
}

.dashboard-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.dashboard-card h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: #1a73e8;
}

.dashboard-card p {
  margin: 0;
  font-size: 0.85rem;
  color: #555;
}
