:root {
  color-scheme: light;
  --bg: #f7f3ee;
  --surface: #fffdf9;
  --surface-strong: #ffffff;
  --ink: #251d18;
  --muted: #75685f;
  --line: #e4d9ce;
  --accent: #0f766e;
  --accent-soft: #d8ebe6;
  --danger: #b42318;
  --warning: #b54708;
  --ok: #16794c;
  --shadow: 0 18px 50px rgba(65, 45, 30, 0.1);
  --sidebar-width: 360px;
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

.app-header {
  align-items: center;
  background: rgba(255, 253, 249, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 82px;
  padding: 18px 28px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

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

h1 {
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 0;
}

.layout {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(260px, var(--sidebar-width)) 10px minmax(0, 1fr);
  height: calc(100vh - 82px);
  padding: 18px;
}

.queue-panel,
.review-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 0;
}

.queue-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.review-panel {
  overflow: auto;
}

.resize-handle {
  align-self: stretch;
  border-radius: 999px;
  cursor: col-resize;
  position: relative;
}

.resize-handle::before {
  background: var(--line);
  border-radius: 999px;
  content: "";
  inset: 8px 4px;
  position: absolute;
  transition: background 0.16s ease;
}

.resize-handle:hover::before,
.resize-handle:focus-visible::before,
.resizing-sidebar .resize-handle::before {
  background: var(--accent);
}

.resizing-sidebar {
  cursor: col-resize;
  user-select: none;
}

.status-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px;
}

.tab-button,
.icon-button,
.mode-button,
.logout-button,
.action-button {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
}

.mode-button,
.logout-button {
  background: var(--surface-strong);
  color: var(--muted);
}

.logout-button {
  padding-inline: 12px;
}

.logout-button:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.mode-button.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.tab-button {
  background: var(--surface-strong);
  color: var(--muted);
  flex: 0 0 auto;
}

.tab-button.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.icon-button,
.action-button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.action-button.secondary {
  background: #fff;
  color: var(--ink);
}

.action-button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.action-button:disabled {
  cursor: default;
  opacity: 0.52;
}

.queue-meta {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  padding: 0 16px 12px;
}

.submission-list {
  overflow: auto;
  padding: 10px;
}

.submission-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 10px;
  padding: 14px;
  text-align: left;
  width: 100%;
}

.submission-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.16);
}

.submission-card h3 {
  font-size: 16px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.card-meta,
.metric-label,
.muted {
  color: var(--muted);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 8px;
}

.author-chip,
.author-panel {
  align-items: center;
  display: flex;
  gap: 10px;
}

.author-chip {
  margin: 8px 0 10px;
}

.author-panel {
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: min(100%, 420px);
  padding: 12px;
}

.author-avatar {
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 999px;
  color: var(--accent);
  display: flex;
  flex: 0 0 42px;
  font-size: 14px;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.author-chip .author-avatar {
  flex-basis: 30px;
  font-size: 11px;
  height: 30px;
  width: 30px;
}

.author-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.author-copy strong,
.author-copy span,
.author-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-copy span,
.author-copy small {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  align-items: center;
  background: #f2eee8;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  min-height: 26px;
  padding: 0 10px;
  white-space: nowrap;
}

.badge.warning {
  background: #fff2d7;
  color: var(--warning);
}

.badge.danger {
  background: #ffe4df;
  color: var(--danger);
}

.badge.ok {
  background: #dcfce7;
  color: var(--ok);
}

.detail-content {
  padding: 22px;
}

.empty-state {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.hidden {
  display: none !important;
}

.detail-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.detail-title h2 {
  font-size: 30px;
  line-height: 1.12;
  margin-bottom: 10px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.status-note {
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
  max-width: 360px;
  padding: 12px 14px;
}

.publish-guidance {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: var(--ok);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  max-width: 320px;
  padding: 10px 12px;
}

.creator-review-section {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.section-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.metric-card,
.content-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric-value {
  font-size: 24px;
  font-weight: 900;
  margin-top: 4px;
}

.content-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

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

.content-section h3 {
  font-size: 17px;
  margin-bottom: 12px;
}

.kv-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kv {
  background: #faf7f2;
  border-radius: 8px;
  padding: 10px;
}

.kv dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}

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

.list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.duplicate-row,
.action-log-row {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding: 12px 0;
}

.duplicate-row:first-child,
.action-log-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.pair-list {
  display: grid;
  gap: 8px;
}

.pair-row {
  background: #faf7f2;
  border-radius: 8px;
  overflow-wrap: anywhere;
  padding: 10px;
}

.pair-row strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.pair-row p {
  color: var(--muted);
  margin: 0;
}

.subsection-title {
  font-size: 14px;
  margin: 16px 0 8px;
}

.duplicate-main {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.score-bars {
  display: grid;
  gap: 6px;
}

.score-bar {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 92px minmax(0, 1fr) 44px;
}

.bar-track {
  background: #eee5dc;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.bar-fill {
  background: var(--accent);
  height: 100%;
}

.raw-json {
  background: #211a16;
  border-radius: 8px;
  color: #fff7ec;
  font-size: 12px;
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

.image-review-section {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 220px;
}

.submitted-image-preview {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  object-fit: cover;
  width: 100%;
}

.toast {
  background: #211a16;
  border-radius: 8px;
  bottom: 20px;
  color: #fff;
  left: 50%;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 20;
}

textarea.note-input {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 90px;
  padding: 10px;
  resize: vertical;
  width: 100%;
}

@media (max-width: 980px) {
  .layout,
  .content-grid,
  .section-grid {
    grid-template-columns: 1fr;
  }

  .layout {
    height: auto;
  }

  .queue-panel {
    max-height: 56vh;
  }

  .detail-header {
    display: block;
  }

  .action-row {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .image-review-section {
    grid-template-columns: 1fr;
  }
}


.summary-stack {
  display: grid;
  gap: 10px;
}

.metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.metric-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 14px;
}

.metric-card span,
.metric-card small,
.note {
  color: var(--muted);
}

.metric-card strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.section-heading {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.section-heading > span {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 13px;
}

.data-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

.data-table {
  border-collapse: collapse;
  min-width: 620px;
  width: 100%;
}

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

.data-table th {
  background: #faf7f2;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.data-table td small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
  word-break: break-all;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 760px) {
  .app-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .resize-handle {
    display: none;
  }

  .queue-panel,
  .review-panel {
    min-height: 280px;
  }
}


.sort-button {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font-size: inherit;
  font-weight: inherit;
  gap: 6px;
  letter-spacing: inherit;
  padding: 0;
  text-align: left;
  text-transform: inherit;
  width: 100%;
}

.sort-button.active {
  color: var(--accent);
}
