:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7fb;
  color: #17202a;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
}

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

button,
.primary-action {
  border: 0;
  border-radius: 6px;
  background: #146c5f;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  text-decoration: none;
  white-space: normal;
  text-align: center;
  max-width: 100%;
}

button.secondary {
  background: #e9edf3;
  color: #17202a;
}

button.danger {
  background: #b42318;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #ccd5df;
  border-radius: 6px;
  background: #fff;
  color: #17202a;
  min-height: 40px;
  padding: 10px 12px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 22px clamp(16px, 4vw, 40px);
  background: #17202a;
  color: #fff;
}

.topbar h1,
.panel h2 {
  margin: 0;
  line-height: 1.15;
}

.topbar h1 {
  font-size: 28px;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 48px;
  max-width: 100%;
}

.grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

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

.panel {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 18px;
  min-width: 0;
  box-shadow: 0 1px 2px rgba(23, 32, 42, 0.05);
}

.status-panel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #5b6776;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: #b8c5d1;
}

.muted {
  color: #5b6776;
  margin: 0;
}

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

.checkline {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: #344054;
}

.checkline span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.checkline input {
  width: auto;
  min-height: 0;
}

.list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.list.compact {
  margin-top: 12px;
}

.item {
  border: 1px solid #e1e7ef;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meta {
  color: #5b6776;
  font-size: 13px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  background: #e8f2ef;
  color: #146c5f;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(360px, calc(100vw - 32px));
  background: #17202a;
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

.preview-panel {
  display: grid;
  gap: 12px;
}

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.preview-image {
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: 8px;
  border: 1px solid #dbe2ea;
  object-fit: contain;
  background: #f6f7fb;
}

.stack.compact label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #344054;
}

.inline-top {
  margin-top: 12px;
}

.item.selectable {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  align-items: start;
  justify-content: stretch;
  text-align: left;
  cursor: pointer;
  border: 1px solid #e1e7ef;
  background: #fbfcfe;
}

.item.selectable.selected {
  border-color: #146c5f;
  box-shadow: 0 0 0 2px rgba(20, 108, 95, 0.15);
}

.swatch {
  display: block;
  width: 100%;
  max-width: 120px;
  height: 28px;
  border-radius: 6px;
}

.warning {
  color: #b54708;
  margin: 0;
  font-size: 13px;
}

.error-text {
  color: #b42318;
  font-size: 13px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meta-block p {
  margin: 4px 0;
}

@media (max-width: 760px) {
  .topbar,
  .status-panel,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: 24px;
  }
}

.topbar .actions,
.topbar .primary-action + .primary-action {
  margin-left: 8px;
}

.dropzone {
  display: grid;
  gap: 8px;
  place-items: center;
  text-align: center;
  border: 2px dashed #9fb0c3;
  border-radius: 12px;
  background: #fff;
  padding: 28px 16px;
  cursor: pointer;
}

.dropzone.dragover {
  border-color: #146c5f;
  background: #eef7f4;
}

.card {
  border: 1px solid #dde4ec;
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}

#upload-status.hidden,
.hidden {
  display: none !important;
}
