:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-muted: #eef2f5;
  --text: #1d252d;
  --muted: #657180;
  --line: #d8dee6;
  --accent: #2f6fed;
  --accent-dark: #2457ba;
  --danger: #b3261e;
  --success: #1f7a4d;
  --warning: #8a5a00;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  padding: 0.75rem 1rem;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  background: #9aa6b2;
  cursor: not-allowed;
}

.site-header {
  background: #1f2933;
  color: #ffffff;
}

.site-header__inner,
.app-shell,
.site-footer {
  margin: 0 auto;
  max-width: 1120px;
  padding: 2rem 1rem;
}

.eyebrow {
  color: #b8c6d6;
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.catch-copy {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.description {
  color: #e2e8f0;
  margin-bottom: 0;
  max-width: 760px;
}

.app-shell {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(12, 1fr);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.upload-panel,
.validation-panel,
#validation-summary-section,
.preview-panel,
.comparison-panel,
.privacy-panel {
  grid-column: span 12;
}

.settings-panel,
.image-list-panel,
.result-panel,
.error-panel {
  grid-column: span 6;
}

.drop-zone {
  align-items: center;
  background: var(--surface-muted);
  border: 2px dashed #93a4b8;
  border-radius: var(--radius);
  display: grid;
  gap: 1rem;
  justify-items: center;
  min-height: 180px;
  padding: 1.5rem;
  text-align: center;
}

.drop-zone.is-dragging {
  background: #e8f0ff;
  border-color: var(--accent);
}

.drop-zone p,
.empty-state,
.preview-box {
  color: var(--muted);
}

.file-summary {
  color: var(--muted);
  margin: 0.75rem 0 0;
}

.file-list {
  margin: 0;
  padding-left: 1.25rem;
}

.file-list li + li {
  margin-top: 0.35rem;
}

.message-list {
  display: grid;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.message-box,
#validation-summary,
#error-list {
  max-height: 220px;
  overflow-y: auto;
}

.message-item {
  border-left: 4px solid var(--line);
  border-radius: 6px;
  line-height: 1.5;
  min-width: 0;
  overflow-wrap: break-word;
  padding: 0.65rem 0.75rem;
  word-break: normal;
}

.message-item--success {
  background: #eaf7ef;
  border-color: var(--success);
  color: #145c38;
}

.message-item--warning,
.message-item--excluded {
  background: #fff6df;
  border-color: var(--warning);
  color: #684400;
}

.message-item--error {
  background: #fdecea;
  border-color: var(--danger);
  color: #8c1d18;
}

.message-item--processing {
  background: #edf4ff;
  border-color: var(--accent);
  color: #174ea6;
}

.message-item--muted {
  background: var(--surface-muted);
  border-color: var(--line);
  color: var(--muted);
}

.image-table-wrap {
  overflow-x: auto;
}

.image-table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

.image-table th,
.image-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.image-table th {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.image-table tr {
  cursor: pointer;
}

.image-table tr:hover,
.image-table tr.is-selected {
  background: #edf4ff;
}

.image-table tr.row-state--success {
  background: #f3fbf6;
}

.image-table tr.row-state--error {
  background: #fff5f4;
}

.image-table tr.row-state--excluded {
  background: #fff9ea;
}

.status-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
}

.status-badge--processing {
  background: #dce9ff;
  color: #174ea6;
}

.status-badge--success {
  background: #dff3e7;
  color: #145c38;
}

.status-badge--error {
  background: #fad8d5;
  color: #8c1d18;
}

.status-badge--excluded {
  background: #ffe8a8;
  color: #684400;
}

.file-name-cell {
  max-width: 280px;
  overflow-wrap: anywhere;
}

.settings-grid,
.comparison-grid,
.preview-grid {
  display: grid;
  gap: 1rem;
}

.settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  width: 100%;
}

.preview-grid,
.comparison-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.comparison-note {
  color: var(--muted);
  margin-bottom: 1rem;
}

.comparison-card {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.comparison-card h3 {
  color: var(--text);
}

.comparison-card--future {
  background: #fff9ea;
  border-color: #f0d27a;
}

.comparison-card--future #pro-message {
  color: #684400;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.comparison-list {
  color: var(--muted);
  margin: 0;
  padding-left: 1.25rem;
}

.comparison-list li + li {
  margin-top: 0.35rem;
}

.preview-box {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  justify-content: center;
  min-height: 220px;
  padding: 1rem;
  text-align: center;
}

.preview-card {
  align-items: start;
  display: grid;
  gap: 1rem;
  justify-items: start;
  text-align: left;
  width: 100%;
}

.preview-card__title {
  color: var(--text);
  font-weight: 700;
  margin: 0;
}

.preview-card--result {
  background: #f3fbf6;
  border: 1px solid #b9e4c9;
  border-radius: var(--radius);
  padding: 1rem;
}

.preview-card img {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: block;
  max-height: 320px;
  max-width: 100%;
  object-fit: contain;
}

.preview-meta {
  display: grid;
  gap: 0.4rem;
  margin: 0;
}

.preview-meta div {
  display: grid;
  gap: 0.2rem;
}

.preview-meta dt {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.preview-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.empty-state {
  background: var(--surface-muted);
  border-radius: var(--radius);
  padding: 1rem;
}

.privacy-content {
  color: var(--text);
}

.privacy-content p {
  margin-bottom: 0.75rem;
}

.privacy-list {
  color: var(--muted);
  margin: 0;
  padding-left: 1.25rem;
}

.privacy-list li + li {
  margin-top: 0.35rem;
}

.error-panel {
  border-color: #f0b8b4;
}

.error-panel h2 {
  color: var(--danger);
}

.site-footer {
  color: var(--muted);
  padding-top: 0;
}

.site-footer p {
  border-top: 1px solid var(--line);
  margin: 0;
  padding-top: 1rem;
}

@media (max-width: 760px) {
  .settings-panel,
  .image-list-panel,
  .result-panel,
  .error-panel {
    grid-column: span 12;
  }

  .settings-grid,
  .preview-grid,
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}
