:root {
  color-scheme: light;
  --paper: #f7f7f4;
  --surface: #ffffff;
  --surface-muted: #eef5f3;
  --ink: #1f2428;
  --muted: #66716d;
  --line: #d8ddd7;
  --teal: #247b73;
  --teal-strong: #166259;
  --coral: #b84b3f;
  --mustard: #9d7417;
  --green: #4f7a3d;
  --panel-surface: rgba(255, 255, 255, 0.94);
  --panel-surface-muted: rgba(238, 245, 243, 0.88);
  --shadow: 0 18px 45px rgba(31, 36, 40, 0.1);
  --watermark-opacity: 0.18;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101412;
  --surface: #181d1b;
  --surface-muted: #22302d;
  --ink: #edf2ef;
  --muted: #a8b5af;
  --line: #35413d;
  --teal: #56c3b6;
  --teal-strong: #2f9e91;
  --coral: #e17366;
  --mustard: #f0c15b;
  --green: #8fcf77;
  --panel-surface: rgba(24, 29, 27, 0.92);
  --panel-surface-muted: rgba(34, 48, 45, 0.86);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --watermark-opacity: 0.14;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  isolation: isolate;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("./assets/collectibles-watermark.svg");
  background-position: 28px 36px;
  background-repeat: repeat;
  background-size: 540px 540px;
  opacity: var(--watermark-opacity);
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

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

button,
a {
  touch-action: manipulation;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 900px) auto;
  gap: 16px;
  align-items: center;
  padding: 22px clamp(16px, 4vw, 42px);
  background: var(--panel-surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 4;
}

.app-header h1,
.section-heading h2,
.section-heading h3,
.dialog-header h2,
.dialog-heading h2,
.empty-state h3,
.process-note h2 {
  margin: 0;
  line-height: 1.1;
}

.app-header h1 {
  font-size: 28px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.profile-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  max-width: 190px;
  padding: 4px 10px 4px 4px;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.profile-button span,
.profile-identity span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  color: #ffffff;
  background: var(--teal);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}

.profile-button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.sync-button svg {
  width: 18px;
  height: 18px;
}

.sync-button.synced {
  color: #ffffff;
  background: var(--green);
  border-color: transparent;
}

.sync-button.pending,
.sync-button.syncing,
.sync-button.ready {
  color: var(--ink);
  background: #fff8e6;
  border-color: #ead492;
}

.sync-button.error {
  color: #ffffff;
  background: var(--coral);
  border-color: transparent;
}

.sync-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  display: grid;
  gap: 18px;
  width: min(460px, 100%);
  padding: 24px;
  background: var(--panel-surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.auth-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.search-field {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: center;
  flex: 1 1 260px;
  min-width: 280px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.search-field svg {
  width: 18px;
  color: var(--muted);
}

.search-field input {
  width: 100%;
  min-height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(300px, 420px) minmax(0, 1fr);
  gap: 20px;
  padding: 22px clamp(16px, 4vw, 42px) 40px;
}

.side-panel,
.entry-panel,
.catalog-panel,
.label-workbench,
.inventory-print-workbench,
.yard-sale-workbench,
.price-tag-workbench,
.sale-list-print-workbench {
  min-width: 0;
}

.entry-panel,
.catalog-panel,
.label-workbench,
.inventory-print-workbench,
.yard-sale-workbench,
.price-tag-workbench,
.sale-list-print-workbench {
  background: var(--panel-surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.entry-panel,
.catalog-panel {
  padding: 18px;
}

.section-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.stat-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.first-run-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  margin-bottom: 16px;
  background: var(--panel-surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.checklist-heading strong {
  display: block;
  font-size: 16px;
}

.icon-button.small {
  width: 32px;
  height: 32px;
}

.checklist {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.checklist li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.checklist li > span {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 2px solid var(--line);
  border-radius: 50%;
}

.checklist li.complete > span {
  position: relative;
  background: #0f7a4f;
  border-color: #0f7a4f;
}

.checklist li.complete > span::after {
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.checklist strong {
  display: block;
  font-size: 13px;
}

.checklist small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.35;
}

.backup-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  margin-bottom: 16px;
  background: var(--panel-surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.backup-panel strong {
  display: block;
  font-size: 16px;
}

.backup-panel small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.backup-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.backup-status.ok {
  color: #0f7a4f;
  border-color: rgba(15, 122, 79, 0.35);
  background: rgba(15, 122, 79, 0.1);
}

.backup-status.due {
  color: #9a3412;
  border-color: rgba(154, 52, 18, 0.35);
  background: rgba(154, 52, 18, 0.1);
}

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

.backup-import-button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.backup-import-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.stat-grid article,
.process-note,
.empty-state {
  padding: 16px;
  background: var(--panel-surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-grid span {
  display: block;
  font-size: 24px;
  font-weight: 800;
}

.stat-grid p,
.process-note p,
.empty-state p,
.item-card p,
.detail-list,
.muted {
  margin: 6px 0 0;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  outline-color: var(--teal);
}

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

.entry-form {
  display: grid;
  gap: 12px;
}

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

.photo-capture {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  overflow: hidden;
  background: var(--panel-surface-muted);
  border: 1px dashed var(--teal);
  border-radius: 8px;
}

.photo-capture img,
.detail-media img,
.item-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 180px;
  color: var(--muted);
  font-weight: 800;
}

.file-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.photo-capture .danger {
  position: absolute;
  top: 12px;
  right: 12px;
}

.button,
.icon-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.button {
  min-height: 42px;
  gap: 8px;
  padding: 0 14px;
  border-radius: 8px;
}

.button svg {
  width: 18px;
  height: 18px;
}

.button.primary {
  color: #ffffff;
  background: var(--teal);
}

.button.primary:hover {
  background: var(--teal-strong);
}

.button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.button.secondary {
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.button.compact-action {
  min-height: 38px;
  padding-inline: 10px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-muted);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.icon-button.danger {
  color: #ffffff;
  background: var(--coral);
}

.text-button {
  min-height: 36px;
  padding: 0;
  color: var(--teal);
  background: transparent;
}

.form-actions,
.card-actions,
.link-strip,
.comp-summary,
.workbench-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.item-card {
  display: grid;
  grid-template-rows: 180px 1fr;
  overflow: hidden;
  background: var(--panel-surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.app-header,
.entry-panel,
.catalog-panel,
.backup-panel,
.label-workbench,
.inventory-print-workbench,
.yard-sale-workbench,
.price-tag-workbench,
.sale-list-print-workbench,
.stat-grid article,
.process-note,
.empty-state,
.item-card {
  background-image:
    linear-gradient(var(--panel-surface), var(--panel-surface)),
    url("./assets/collectibles-watermark.svg");
  background-position: 0 0, 28px 36px;
  background-repeat: repeat, repeat;
  background-size: auto, 540px 540px;
}

.image-button {
  width: 100%;
  min-height: 180px;
  padding: 0;
  overflow: hidden;
  color: var(--green);
  background: var(--panel-surface-muted);
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.item-content {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.item-content h3 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.2;
}

.code {
  margin: 0;
  color: var(--mustard);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}

.item-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.sale-form-section {
  padding: 14px;
  background: var(--panel-surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sale-form-section .field {
  margin-bottom: 0;
}

.sale-pill {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px !important;
  padding: 5px 8px;
  color: var(--ink) !important;
  background: #fff8e6;
  border: 1px solid #ead492;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.sale-pill.sell {
  background: #e8f6ef;
  border-color: #aad4bd;
}

.sale-pill.sold {
  background: #e8f0fb;
  border-color: #a8bee2;
}

.sale-pill.donated {
  background: #f2ece3;
  border-color: #d8c6aa;
}

:root[data-theme="dark"] .sale-pill {
  background: #3c3320;
  border-color: #735d27;
}

.detail-dialog {
  width: min(1040px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(31, 36, 40, 0.24);
}

.profile-dialog,
.sale-share-dialog,
.transfer-dialog,
.backup-preview-dialog {
  width: min(620px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(31, 36, 40, 0.24);
}

.profile-dialog::backdrop,
.sale-share-dialog::backdrop,
.transfer-dialog::backdrop,
.backup-preview-dialog::backdrop {
  background: rgba(0, 0, 0, 0.48);
}

.profile-form {
  padding: 22px;
  background: var(--surface);
}

.sale-share-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 22px;
  background: var(--surface);
}

.transfer-dialog {
  width: min(820px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 22px;
  background: var(--surface);
}

.backup-preview-dialog {
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 22px;
  background: var(--surface);
}

.sale-share-layout {
  display: grid;
  gap: 14px;
}

.transfer-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.transfer-summary article {
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.transfer-summary span {
  display: block;
  font-size: 20px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.transfer-summary p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.transfer-card {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: start;
  min-height: 96px;
  padding: 14px;
  color: var(--ink);
  background: var(--panel-surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.transfer-card svg {
  grid-row: span 2;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.transfer-card span {
  font-weight: 900;
}

.transfer-card small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.transfer-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.transfer-steps article {
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.transfer-steps strong {
  display: block;
  margin-bottom: 8px;
}

.transfer-steps ol {
  display: grid;
  gap: 6px;
  padding-left: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.sale-share-preview {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sale-share-preview img,
.sale-share-preview .photo-empty {
  width: 112px;
  height: 92px;
  min-height: 92px;
  object-fit: cover;
  border-radius: 8px;
}

.sale-share-preview h3 {
  margin: 4px 0;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.sale-share-preview strong {
  font-size: 20px;
}

.sale-share-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.sale-channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.sale-channel-grid button {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 12px;
  color: var(--ink);
  background: var(--panel-surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.sale-channel-grid span {
  font-weight: 900;
}

.sale-channel-grid small {
  color: var(--muted);
  font-weight: 750;
}

.profile-identity {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  margin-bottom: 16px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-identity span {
  width: 46px;
  height: 46px;
  font-size: 16px;
}

.profile-identity strong {
  display: block;
  font-size: 18px;
}

.profile-identity p {
  margin: 4px 0 0;
  color: var(--muted);
}

.detail-dialog::backdrop {
  background: rgba(31, 36, 40, 0.45);
}

.dialog-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  min-height: 620px;
  background: var(--surface);
}

.detail-media {
  min-height: 360px;
  background: var(--surface-muted);
}

.detail-content {
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 22px;
}

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

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

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

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

.backup-preview-grid article,
.backup-preview-details div,
.backup-sample {
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.backup-preview-grid span {
  display: block;
  font-size: 22px;
  font-weight: 900;
}

.backup-preview-grid p,
.backup-preview-details dt {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.backup-preview-details {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.backup-preview-details dd {
  margin: 4px 0 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.backup-sample ul {
  display: grid;
  gap: 4px;
  padding-left: 18px;
  margin: 8px 0 0;
}

.warning-text {
  margin: 14px 0;
  color: #9a3412;
  font-weight: 750;
  line-height: 1.45;
}

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

.detail-list div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-list dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.notes {
  padding: 14px 0;
  border-block: 1px solid var(--line);
  line-height: 1.5;
}

.comparables {
  display: grid;
  gap: 14px;
}

.link-strip a {
  min-height: 36px;
  padding: 8px 10px;
  color: var(--teal);
  background: var(--surface-muted);
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.comp-summary span {
  padding: 8px 10px;
  color: var(--ink);
  background: #fff8e6;
  border: 1px solid #ead492;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

:root[data-theme="dark"] .comp-summary span,
:root[data-theme="dark"] .status-badge {
  background: #3c3320;
  border-color: #735d27;
}

.provider-form {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.provider-form .field {
  margin: 0;
}

.provider-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.provider-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.provider-status span {
  padding: 5px 8px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.candidate-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.candidate-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--mustard);
  border-radius: 8px;
}

.candidate-card.accepted {
  border-left-color: var(--green);
}

.candidate-card.rejected {
  border-left-color: var(--coral);
  opacity: 0.74;
}

.candidate-card strong,
.candidate-card p {
  overflow-wrap: anywhere;
}

.candidate-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

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

.candidate-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.candidate-actions {
  justify-content: flex-end;
}

.candidate-actions a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  color: var(--teal);
  font-weight: 800;
}

.status-badge {
  padding: 4px 7px;
  color: var(--ink);
  background: #fff8e6;
  border: 1px solid #ead492;
  border-radius: 999px;
  text-transform: capitalize;
}

.error-text {
  margin: 0;
  color: var(--coral);
  font-weight: 800;
}

.comparable-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 8px;
}

.comparable-form .field:nth-last-of-type(1),
.comparable-form button {
  grid-column: 1 / -1;
}

.comparable-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.comparable-list li {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.comparable-list span {
  color: var(--muted);
}

.comparable-list a {
  color: var(--teal);
  font-weight: 800;
}

.yard-sale-workbench,
.price-tag-workbench,
.sale-list-print-workbench {
  margin: 0 clamp(16px, 4vw, 42px) 40px;
  padding: 18px;
}

.sale-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.sale-dashboard article {
  padding: 14px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sale-dashboard span {
  display: block;
  font-size: 22px;
  font-weight: 900;
}

.sale-dashboard p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.sale-list {
  display: grid;
  gap: 10px;
}

.sale-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) 150px minmax(250px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--mustard);
  border-radius: 8px;
}

.sale-card.sell {
  border-left-color: var(--green);
}

.sale-card.sold {
  border-left-color: var(--teal);
}

.sale-card.donated {
  border-left-color: var(--muted);
}

.sale-card h3 {
  margin: 4px 0 0;
  font-size: 17px;
  line-height: 1.2;
}

.sale-card p,
.sale-card-note {
  margin: 5px 0 0;
  color: var(--muted);
}

.sale-card-note {
  overflow-wrap: anywhere;
}

.sale-status-block {
  display: grid;
  gap: 6px;
}

.sale-status-block small {
  color: var(--muted);
  font-weight: 800;
}

.sale-status {
  width: fit-content;
  padding: 6px 9px;
  color: #ffffff;
  background: var(--teal);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.sale-price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.sale-price-grid div {
  padding: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sale-price-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.sale-price-grid dd {
  margin: 4px 0 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.sale-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.label-workbench {
  margin: 0 clamp(16px, 4vw, 42px) 40px;
  padding: 18px;
}

.inventory-print-workbench {
  margin: 0 clamp(16px, 4vw, 42px) 40px;
  padding: 18px;
}

.label-workbench:empty,
.inventory-print-workbench:empty,
.price-tag-workbench:empty,
.sale-list-print-workbench:empty {
  display: none;
}

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

.inline-field {
  display: grid;
  gap: 5px;
  min-width: 150px;
}

.inline-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.print-label {
  display: grid;
  gap: 6px;
  min-height: 164px;
  padding: 10px;
  border: 1px solid #111111;
  border-radius: 4px;
  background: #ffffff;
  color: #111111;
  page-break-inside: avoid;
}

.print-label.avery-5160 {
  min-height: 118px;
  padding: 7px;
  gap: 4px;
}

.print-label.large-tag {
  min-height: 208px;
  padding: 14px;
}

.print-label strong,
.print-label span,
.print-label p,
.print-label small {
  overflow-wrap: anywhere;
}

.print-label p {
  margin: 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
}

.print-label small {
  color: #333333;
  font-size: 10px;
}

.label-code-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.qr-code {
  display: block;
  width: 82px;
  height: 82px;
  border: 1px solid #111111;
}

.print-label.avery-5160 .qr-code {
  width: 54px;
  height: 54px;
}

.print-label.avery-5160 small {
  display: none;
}

.print-label.avery-5160 .barcode {
  height: 36px;
}

.print-label.large-tag .qr-code {
  width: 96px;
  height: 96px;
}

.barcode {
  width: 100%;
  height: 54px;
}

.price-tag-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.sale-price-tag {
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-height: 190px;
  padding: 14px;
  color: #111111;
  background: #ffffff;
  border: 2px solid #111111;
  border-radius: 4px;
  page-break-inside: avoid;
}

.tag-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #333333;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.tag-price {
  display: block;
  font-size: 40px;
  line-height: 1;
}

.sale-price-tag h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.sale-price-tag p {
  margin: 0;
  font-weight: 900;
}

.sale-price-tag small {
  color: #333333;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 900;
}

.inventory-print-header {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px;
  margin-bottom: 14px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.inventory-print-header div {
  display: grid;
  gap: 4px;
}

.inventory-print-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.inventory-print-table-wrap {
  overflow-x: auto;
}

.inventory-print-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  overflow-wrap: anywhere;
}

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

.inventory-print-table th {
  color: var(--ink);
  background: var(--surface-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.inventory-print-table td {
  color: var(--ink);
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 6;
  margin: 0;
  padding: 12px 14px;
  color: #ffffff;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .catalog-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  body::before {
    background-position: 18px 24px;
    background-size: 420px 420px;
  }

  .app-header,
  .app-shell,
  .dialog-layout {
    grid-template-columns: 1fr;
  }

  .app-header {
    position: static;
  }

  .header-actions,
  .search-field {
    width: 100%;
    min-width: 0;
  }

  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-button,
  .sync-button,
  .header-actions > .icon-button,
  .button {
    width: 100%;
    max-width: none;
  }

  .side-panel {
    order: 3;
  }

  .form-grid,
  .detail-list,
  .comparable-form,
  .provider-form,
  .provider-fields,
  .candidate-card,
  .sale-dashboard,
  .sale-card,
  .sale-price-grid,
  .sale-share-actions,
  .sale-share-preview,
  .backup-preview-grid,
  .transfer-summary,
  .transfer-actions,
  .transfer-steps {
    grid-template-columns: 1fr;
  }

  .sale-share-preview img,
  .sale-share-preview .photo-empty {
    width: 100%;
    height: 180px;
  }

  .candidate-actions,
  .sale-actions {
    justify-content: stretch;
  }

  .provider-actions {
    display: grid;
    justify-items: stretch;
  }

  .provider-status {
    justify-content: flex-start;
  }

  .dialog-layout {
    min-height: auto;
  }

  .detail-content {
    max-height: none;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  body::before {
    display: none;
  }

  .app-header,
  .app-shell,
  .toast,
  .yard-sale-workbench,
  .sale-share-dialog,
  .transfer-dialog,
  .backup-preview-dialog,
  .label-workbench > .section-heading,
  .inventory-print-workbench > .section-heading,
  .price-tag-workbench > .section-heading,
  .sale-list-print-workbench > .section-heading,
  .detail-dialog {
    display: none !important;
  }

  .label-workbench,
  .inventory-print-workbench,
  .price-tag-workbench,
  .sale-list-print-workbench {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background-image: none;
    box-shadow: none;
  }

  .label-sheet {
    grid-template-columns: repeat(2, 3.75in);
    gap: 0.12in;
  }

  .label-sheet.avery-5160 {
    grid-template-columns: repeat(3, 2.625in);
    grid-auto-rows: 1in;
    gap: 0;
  }

  .label-sheet.large-tag {
    grid-template-columns: repeat(2, 3.5in);
    gap: 0.14in;
  }

  .print-label {
    min-height: 1.75in;
    border-radius: 0;
  }

  .print-label.avery-5160 {
    width: 2.625in;
    min-height: 1in;
    padding: 0.07in;
  }

  .print-label.large-tag {
    width: 3.5in;
    min-height: 2in;
  }

  .price-tag-sheet {
    grid-template-columns: repeat(3, 2.35in);
    gap: 0.12in;
  }

  .sale-price-tag {
    min-height: 1.85in;
    border-radius: 0;
  }

  .tag-price {
    font-size: 34px;
  }

  .inventory-print-header {
    color: #111111;
    background: #ffffff;
    border-color: #111111;
  }

  .inventory-print-header span {
    color: #333333;
  }

  .inventory-print-table th,
  .inventory-print-table td {
    color: #111111;
    border-color: #111111;
  }

  .inventory-print-table {
    min-width: 0;
  }

  .inventory-print-table th {
    background: #f2f2f2;
  }
}
