:root {
  color-scheme: light;
  --bg: #f6f5ef;
  --panel: #ffffff;
  --text: #202527;
  --muted: #687477;
  --line: #d9ddd5;
  --accent: #2b6860;
  --accent-strong: #1e504a;
  --ink: #4b4f3b;
  --danger: #a33c34;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.page.wide {
  width: min(1360px, calc(100% - 32px));
}

.page.narrow {
  width: min(640px, calc(100% - 32px));
}

.topbar,
.album-nav,
.album-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar,
.album-nav {
  margin-bottom: 20px;
}

.eyebrow,
.album-count,
.hint,
.album-nav span,
.section-heading span,
.album-description {
  color: var(--muted);
  font-size: 0.92rem;
}

.eyebrow {
  margin: 0 0 6px;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  margin: 0 0 22px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
}

h2 {
  margin: 0;
  font-size: 1.1rem;
}

h3 {
  margin: 0 0 8px;
}

.album-heading {
  align-items: start;
  margin-bottom: 24px;
}

.album-heading h1 {
  margin-bottom: 8px;
}

.album-description {
  margin: 0;
}

.upload-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto auto auto;
  align-items: end;
  gap: 12px;
  padding: 16px;
  margin-bottom: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
}

.file-picker {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

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

.danger-button {
  background: var(--danger);
}

.danger-button:hover {
  background: #822f29;
}

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

.album-card {
  display: grid;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.album-card img,
.empty-cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: #dfe3d7;
}

.album-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.status-pill {
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.8rem;
  text-transform: capitalize;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 24px;
  align-items: start;
}

.page-review-list {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.page-review-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.review-image {
  display: grid;
  gap: 8px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.review-image img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.review-content {
  min-width: 0;
}

.review-title,
.review-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.review-title {
  margin-bottom: 10px;
}

.review-title h3 {
  margin: 0;
}

.review-title span,
.review-meta,
.review-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.review-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.review-item strong {
  display: block;
  margin: 8px 0;
}

.review-item pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.5;
}

.source-pages,
.converted-items,
.placeholder-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.section-heading {
  margin-bottom: 14px;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}

.page-card {
  display: grid;
  gap: 6px;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.page-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.items-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

.items-row {
  display: grid;
  grid-template-columns: 0.8fr 1fr 0.8fr 1fr 1fr 0.7fr 1fr 2fr;
  min-width: 1080px;
  border-top: 1px solid var(--line);
}

.items-row:first-child {
  border-top: 0;
}

.items-row span {
  padding: 10px;
  overflow-wrap: anywhere;
}

.items-row.header {
  background: #eef1eb;
  color: var(--ink);
  font-weight: 800;
}

.notes-cell {
  white-space: pre-wrap;
  line-height: 1.45;
}

.placeholder-panel {
  color: var(--muted);
}

.placeholder-panel p {
  margin: 0;
  line-height: 1.5;
}

.empty-state {
  color: var(--muted);
}

.error-message {
  color: var(--danger);
  font-weight: 700;
}

.text-link,
.album-nav a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 980px) {
  .upload-panel,
  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .album-heading,
  .section-heading {
    display: grid;
  }

  .page-review-card {
    grid-template-columns: 1fr;
  }

  .file-picker,
  button {
    width: 100%;
  }
}
