:root {
  color-scheme: light;
  --bg: #f4f7fa;
  --bg-accent: #e9eff5;
  --ink: #0b1b25;
  --muted: #5b6b76;
  --accent: #014b6e;
  --accent-dark: #013a55;
  --card: #ffffff;
  --line: #d9e3ea;
  --shadow: 0 18px 30px rgba(1, 75, 110, 0.12);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --transition: 200ms ease;
}

* {
  box-sizing: border-box;
}

.low-shipping-shell {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  min-height: 100vh;
}

.page {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 22px;
}

.topbar {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar h1 {
  font-family: "Fraunces", serif;
  font-size: 30px;
  margin: 0 0 6px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 560px;
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(1, 75, 110, 0.12);
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.topbar__credits {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-size: 13px;
  color: var(--muted);
}

.stat-pill__value {
  color: var(--ink);
  font-weight: 700;
}

.stat-pill--accent {
  background: rgba(1, 75, 110, 0.12);
  border-color: rgba(1, 75, 110, 0.3);
  color: var(--ink);
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

.layout--split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.panel {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--panel-accent, #014b6e), #cfe2ed);
  opacity: 0.9;
}

.panel--create {
  --panel-accent: #014b6e;
}

.panel--selection {
  --panel-accent: #6a90a7;
  background: #f7fafc;
}

.panel--results {
  --panel-accent: #98b4c4;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.panel__header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

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

.panel__header--divider {
  padding-bottom: 12px;
  border-bottom: 1px solid #e4ecf2;
}

.form-block {
  display: grid;
  gap: 10px;
}

.form-label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

.callout {
  border-radius: var(--radius-md);
  background: #f1f6f9;
  border: 1px solid #d7e5ee;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
}

.callout strong {
  color: var(--ink);
}

.callout--compact {
  padding: 10px 12px;
}

.file-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(1, minmax(260px, 1fr));
  align-items: start;
}

.file-card {
  border-radius: var(--radius-md);
  border: 1px solid #d8e3ea;
  background: #f9fbfd;
  min-width: 0;
  padding: 12px;
}

.is-processing .file-list,
.is-processing .upload {
  pointer-events: none;
  opacity: 0.7;
}

.is-processing .btn {
  pointer-events: none;
  opacity: 0.7;
}

.is-processing .btn--credit {
  pointer-events: auto;
  opacity: 1;
}

.btn--credit {
  opacity: 1;
}

.is-processing .select2-container--default .select2-selection--multiple {
  background: #f2f4f7;
  border-color: #d5dee5;
  color: #7a8794;
}

.is-processing .select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: #e4e9ee;
  border-color: #cfd8e0;
  color: #6b7784;
}

.is-processing .file-card__name,
.is-processing .file-card__error,
.is-processing .file-card input[type="text"] {
  color: #7a8794;
}

.is-processing .file-card input[type="text"] {
  background: #f2f4f7;
  border-color: #d5dee5;
}

.is-processing .file-card__preview {
  opacity: 0.6;
}

.file-card__body{
    padding: 12px 0px;
}

.file-card__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 13px;
}

.file-card__preview {
  width: 100%;
  height: 120px;
  border-radius: 14px;
  background: #eef4f8;
  border: 1px dashed #c7d8e2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.file-card__preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.file-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.file-card__name {
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.category-select-wrapper {
  width: 100%;
  display: grid;
  gap: 6px;
}

.category-select__label {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.category-select-wrapper .select2-container {
  width: 100% !important;
}

.select2-container--default .select2-dropdown {
  z-index: 2000;
}

.select2-container--default .select2-selection--multiple {
  border-radius: var(--radius-sm);
  border: 1px solid #c9d7e0;
  min-height: 40px;
  padding: 4px 6px;
  background: #ffffff;
  font-family: inherit;
  box-shadow: 0 10px 18px rgba(1, 75, 110, 0.08);
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 0;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  margin: 2px 0 0 0;
  padding: 4px 8px;
  line-height: 1.2;
}

.select2-container--default .select2-results__option[aria-selected="true"],
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--accent-dark);
  color: #ffffff;
}

.select2-container--default .select2-selection--multiple.is-invalid {
  border-color: #f04438;
  background: #fff5f3;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: #e8f2ff;
  border: 1px solid #c7d8e2;
  border-radius: 12px;
  color: #0b3b6c;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: #0b3b6c;
}

.select2-container--default .select2-results__option[aria-selected="true"],
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #cfe2ed;
  color: var(--ink);
}

.select2-option__title {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

.select2-option__subtitle {
  font-size: 12px;
  color: var(--muted);
}

.category-picker {
  width: 100%;
}

.category-picker__label {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.category-picker__toggle {
  width: 100%;
  text-align: left;
  border-radius: var(--radius-sm);
  border: 1px solid #c9d7e0;
  padding: 8px 10px;
  background: #ffffff;
  display: grid;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(1, 75, 110, 0.08);
  position: relative;
  padding-right: 36px;
}

.category-picker__toggle.is-invalid {
  border-color: #f04438;
  background: #fff5f3;
}

.category-picker__title {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

.category-picker__subtitle {
  font-size: 12px;
  color: var(--muted);
}

.category-picker__chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--muted);
}

.category-picker__helper {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.file-card__error {
  font-size: 11px;
  color: #b42318;
}

.file-card__error.is-hidden {
  display: none;
}

.category-picker__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.category-picker__tag {
  background: rgba(1, 75, 110, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
}

.category-menu {
  position: absolute;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid #d2dee6;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow: auto;
  z-index: 50;
}

.category-menu__search {
  background: #ffffff;
  padding: 6px 4px 10px;
  border-bottom: 1px solid #e3edf4;
  margin-bottom: 6px;
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9;
}

.category-menu__search input {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid #c9d7e0;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  background: #ffffff;
  color: var(--ink);
}

.category-menu__list {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.category-menu__option {
  position: relative;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: #f9fbfd;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding-left: 34px;
}

.category-menu__option:hover {
  border-color: #b8cddb;
  background: #eff5f9;
}

.category-menu__option[data-selected="true"] {
  border-color: rgba(1, 75, 110, 0.5);
  background: rgba(1, 75, 110, 0.12);
}

.category-menu__check {
  position: absolute;
  left: 10px;
  top: 12px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid #b8cddb;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--accent);
  background: #ffffff;
}

.category-menu__title {
  font-weight: 600;
  font-size: 13px;
}

.category-menu__subtitle {
  font-size: 12px;
  color: var(--muted);
}

.category-menu__footer {
  border-top: 1px solid #e3edf4;
  padding: 8px 4px 4px;
  display: flex;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  z-index: 99;
  background-color: #ffffff;
}

.panel__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.upload {
  border: 1px dashed #b9cdda;
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  background: linear-gradient(135deg, #f5f9fc, #ffffff);
  position: relative;
}

.upload input {
  display: none;
}

.upload:hover {
  border-color: var(--accent);
  background: #edf4f8;
}

.upload--disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.upload--disabled:hover {
  border-color: #b9cdda;
  background: linear-gradient(135deg, #f5f9fc, #ffffff);
}

.upload__body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.upload__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
}

.upload__body p {
  margin: 0;
  font-weight: 600;
}

.upload__hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.credit-btn {
  border: none;
  background: var(--accent);
  color: #ffffff;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 12px 20px rgba(1, 75, 110, 0.25);
}

.credit-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  color: white;
}

.credit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid #b9cdda;
  box-shadow: none;
}

.btn--ghost:hover {
  background: #eef5f9;
  transform: translateY(-1px);
  color: var(--accent-dark);
}

.btn--small {
  padding: 8px 12px;
  font-size: 13px;
  box-shadow: none;
}

.btn--text {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid #cfe0ea;
  background: #ffffff;
  color: var(--accent);
  box-shadow: none;
}

.btn--text:hover {
  background: #edf6fb;
  color: var(--accent-dark);
}

.hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

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

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

.image-grid--history {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 1140px;
  overflow: auto;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e3edf4;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #014b6e, #5bb6e5);
  position: relative;
  transition: width 250ms ease;
  overflow: hidden;
}

.progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 75%,
    transparent
  );
  background-size: 24px 24px;
  animation: progressStripe 1.2s linear infinite;
}

@keyframes progressStripe {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 48px 0;
  }
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 27, 37, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 999;
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
}

.modal__card {
  position: relative;
  width: min(520px, 100%);
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 1;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: transparent;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
}

.modal__header h2 {
  margin: 0 0 6px;
  font-family: "Fraunces", serif;
  font-size: 24px;
}

.modal__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.modal__form {
  display: grid;
  gap: 12px;
}

.input-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 600;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f7fafc;
  border: 1px solid #d9e3ea;
  border-radius: 12px;
  padding: 8px 12px;
}

.input-row input {
  border: none;
  background: transparent;
  font-size: 16px;
  width: 100%;
  outline: none;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.input-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

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

.is-hidden {
  display: none !important;
}

.credit-pill {
  border: 1px solid #d3e1ea;
  background: #ffffff;
  color: var(--accent);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.credit-pill.is-active,
.credit-pill:hover {
  background: rgba(1, 75, 110, 0.12);
  border-color: rgba(1, 75, 110, 0.4);
}


.input-error {
  margin: 0;
  font-size: 12px;
  color: #a03232;
}

.price-grid {
  display: grid;
  gap: 10px;
  background: #f4f7fa;
  border: 1px solid #d9e3ea;
  border-radius: 14px;
  padding: 14px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
}

.price-row--total {
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
  border-top: 1px dashed #d3dfe8;
  padding-top: 10px;
}

.modal__note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

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

@media (max-width: 640px) {
  .modal__card {
    padding: 22px;
  }

  .modal__actions {
    width: 100%;
  }

  .modal__actions .btn {
    width: 100%;
  }
}

.image-card {
  background: #f9fbfd;
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid #dbe7ef;
  display: grid;
  gap: 8px;
  animation: fadeUp 300ms ease;
}

.image-card__preview {
  min-width: 100%;
  height: 220px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.image-card__preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.image-card__meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

.image-card__meta span:last-child {
  font-weight: 600;
  color: var(--accent);
}

.image-card__category {
  font-size: 12px;
  color: var(--muted);
}

.image-card__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.job-card {
  background: #f9fbfd;
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid #dbe7ef;
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.job-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.job-card__header .btn {
  white-space: nowrap;
}

.job-card__title {
  font-weight: 700;
  font-size: 16px;
}

.job-card__meta {
  font-size: 12px;
  color: var(--muted);
}

.job-card__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.job-card__item {
  display: grid;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  background: #ffffff;
  border: 1px solid #e3edf4;
  border-radius: var(--radius-sm);
  padding: 8px;
}

.job-card__preview {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.job-card__preview--skeleton {
  height: 190px;
  border-radius: 12px;
  background: linear-gradient(110deg, #eef3f7 30%, #f9fbfd 50%, #eef3f7 70%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.2s ease-in-out infinite;
}

.job-card__preview--failed {
  height: 190px;
  border-radius: 12px;
  background: linear-gradient(120deg, #fff1f2 0%, #fde7ea 45%, #f9d4da 100%);
  border: 1px dashed #f2a7b4;
  color: #9d2c3c;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 12px;
}

.job-card__preview--failed span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.job-card__preview--failed span::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #f2a7b4;
  background: #fff5f6;
  color: #b02336;
  font-size: 12px;
  font-weight: 800;
}

@keyframes skeletonShimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.job-card__category {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
  word-break: break-word;
}

.job-card__category strong {
  color: var(--ink);
  font-weight: 700;
  flex: 1 1 auto;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-card__status {
  font-size: 12px;
  color: #5b7f92;
  font-weight: 600;
}

.job-card__charge {
  font-size: 12px;
  font-weight: 700;
  color: #0a6d2f;
  white-space: nowrap;
}


@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

  .panel {
    position: static;
  }

  .file-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 20px 14px 48px;
  }

  .topbar {
    padding: 18px;
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar__credits {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .panel__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .job-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .upload__body {
    flex-direction: column;
    align-items: flex-start;
  }
}
