:root {
  --background: #fbfaf7;
  --surface: #ffffff;
  --surface-strong: #f2f6ee;
  --ink: #050505;
  --muted: #64635f;
  --line: #dfdcd4;
  --brand-black: #050505;
  --brand-blue: #89bbd8;
  --brand-blue-soft: #e7f4fb;
  --brand-sage: #89a780;
  --brand-sage-soft: #edf4ea;
  --brand-coral: #dc6854;
  --brand-coral-soft: #fce6e0;
  --brand-lavender: #9b7abc;
  --brand-lavender-soft: #f2eafa;
  --shadow: 0 22px 70px rgba(5, 5, 5, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  min-width: 320px;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background: var(--background);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 320px;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(137, 187, 216, 0.18), transparent 35%),
    linear-gradient(315deg, rgba(220, 104, 84, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(155, 122, 188, 0.08), transparent 44%),
    var(--background);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

img,
video,
canvas {
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.stash-shell {
  width: min(1480px, 100%);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 32px;
  overflow-x: hidden;
}

.stash-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 176px;
  padding: 8px 0 26px;
}

.brand-intro {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}

.brand-logo {
  width: clamp(156px, 18vw, 260px);
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
}

.brand-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.swatch {
  width: 30px;
  height: 9px;
  border-radius: 999px;
}

.swatch.blue {
  background: var(--brand-blue);
}

.swatch.sage {
  background: var(--brand-sage);
}

.swatch.coral {
  background: var(--brand-coral);
}

.swatch.lavender {
  background: var(--brand-lavender);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-coral);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: 3.1rem;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 4px;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.header-copy {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.header-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
  min-width: min(360px, 100%);
}

.account-row {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  max-width: 420px;
}

.account-pill {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(5, 5, 5, 0.12);
  border-radius: 8px;
  background: var(--brand-sage-soft);
  color: var(--brand-black);
  line-height: 1.2;
}

.account-pill span,
.account-pill small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-pill span {
  font-size: 0.9rem;
  font-weight: 950;
}

.account-pill small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.account-role {
  color: var(--brand-coral) !important;
}

.signout-action {
  flex: 0 0 86px;
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  max-width: 360px;
  padding: 10px 14px;
  border: 1px solid rgba(5, 5, 5, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--brand-black);
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(5, 5, 5, 0.08);
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--brand-coral);
  box-shadow: 0 0 0 4px rgba(220, 104, 84, 0.14);
}

.auth-shell {
  display: grid;
  place-items: start center;
  min-height: 560px;
  padding: 26px 0;
}

.auth-panel {
  width: min(480px, 100%);
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(5, 5, 5, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

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

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid rgba(5, 5, 5, 0.1);
  border-radius: 8px;
  background: var(--brand-blue-soft);
}

.auth-tabs button {
  min-width: 0;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--brand-black);
  font-size: 0.9rem;
  font-weight: 950;
}

.auth-tabs button.is-active {
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(5, 5, 5, 0.1);
}

.auth-form {
  gap: 15px;
}

.stash-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  min-width: 0;
}

.stash-panel,
.catalog-area {
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(5, 5, 5, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.stash-panel {
  position: sticky;
  top: 24px;
  padding: 22px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.stash-form {
  display: grid;
  gap: 14px;
}

.stash-form label,
.catalog-toolbar label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0;
}

.stash-form input,
.stash-form select,
.stash-form textarea,
.catalog-toolbar input,
.catalog-toolbar select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  color: var(--ink);
  outline: none;
  padding: 10px 12px;
  font-size: 1rem;
}

.stash-form textarea {
  min-height: 104px;
  resize: vertical;
}

.stash-form input:focus,
.stash-form select:focus,
.stash-form textarea:focus,
.catalog-toolbar input:focus,
.catalog-toolbar select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(137, 187, 216, 0.26);
}

.image-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.image-drop {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px dashed rgba(5, 5, 5, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(137, 187, 216, 0.26), transparent),
    linear-gradient(315deg, rgba(155, 122, 188, 0.2), transparent),
    #fbfcf8;
  color: var(--brand-black);
  font-weight: 900;
}

.image-drop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.camera-action,
.upload-action {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 900;
  text-align: center;
}

.camera-action {
  width: 100%;
}

.upload-action {
  border: 1px solid var(--line);
  background: #fbfcf8;
  color: var(--brand-black);
  cursor: pointer;
}

.upload-action:hover {
  border-color: var(--brand-blue);
  background: var(--surface-strong);
}

.upload-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.camera-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(5, 5, 5, 0.14);
  border-radius: 8px;
  background: #f7faf5;
}

.camera-panel video {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background: #1f2723;
  object-fit: cover;
}

.camera-panel canvas {
  display: none;
}

.camera-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 10px;
}

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

.form-grid.three {
  grid-template-columns: 0.72fr 1fr 0.78fr;
}

.stock-toggle-row {
  min-width: 0;
}

.stock-toggle {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid rgba(5, 5, 5, 0.1);
  border-radius: 8px;
  background: var(--brand-sage-soft);
  color: var(--brand-black) !important;
  cursor: pointer;
}

.stock-toggle input[type="hidden"],
.stock-toggle input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.toggle-track {
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  padding: 3px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #cfd7ca;
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.toggle-track span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(5, 5, 5, 0.18);
  transition: transform 160ms ease;
}

.stock-toggle input[type="checkbox"]:checked + .toggle-track {
  background: var(--brand-sage);
}

.stock-toggle input[type="checkbox"]:checked + .toggle-track span {
  transform: translateX(20px);
}

.stock-toggle input[type="checkbox"]:focus + .toggle-track {
  box-shadow: 0 0 0 4px rgba(137, 187, 216, 0.26);
}

.stock-fields.is-disabled {
  opacity: 0.62;
}

.stock-fields.is-disabled input {
  cursor: not-allowed;
}

.category-maker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 104px);
  align-items: end;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(5, 5, 5, 0.1);
  border-radius: 8px;
  background: var(--brand-lavender-soft);
}

.category-maker label {
  min-width: 0;
}

.add-category-action {
  width: 100%;
}

.primary-action,
.secondary-action,
.quiet-action,
.stepper button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.primary-action {
  min-height: 48px;
  background: var(--brand-black);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(5, 5, 5, 0.2);
}

.primary-action:hover {
  background: var(--brand-coral);
}

.catalog-area {
  min-height: 680px;
  padding: 22px;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 240px);
  gap: 14px;
  margin-bottom: 16px;
}

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

.stat-strip div {
  min-height: 76px;
  padding: 14px;
  border: 1px solid rgba(5, 5, 5, 0.1);
  border-radius: 8px;
  background: var(--brand-blue-soft);
  color: #315e78;
  font-size: 0.8rem;
  font-weight: 900;
}

.stat-strip div:nth-child(2) {
  background: var(--brand-sage-soft);
  color: #506d49;
}

.stat-strip div:nth-child(3) {
  background: var(--brand-lavender-soft);
  color: #67498b;
}

.stat-strip span {
  display: block;
  margin-bottom: 4px;
  font-size: 1.65rem;
  line-height: 1;
  letter-spacing: 0;
}

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

.stash-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 440px;
  overflow: hidden;
  border: 1px solid rgba(5, 5, 5, 0.12);
  border-radius: 8px;
  background: var(--surface);
}

.item-image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--brand-blue-soft);
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(5, 5, 5, 0.88), rgba(155, 122, 188, 0.76)),
    linear-gradient(315deg, rgba(137, 187, 216, 0.6), transparent);
  color: #ffffff;
  font-size: 2.1rem;
  font-weight: 950;
}

.item-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-black);
  font-size: 0.78rem;
  font-weight: 950;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
}

.item-badge.wishlist {
  color: #67498b;
}

.item-body {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 13px;
  padding: 15px;
}

.item-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.item-title-row p,
.item-notes {
  color: var(--muted);
  line-height: 1.45;
}

.item-title-row p {
  margin-bottom: 0;
  font-size: 0.86rem;
  font-weight: 800;
}

.item-title-row h3,
.item-title-row p,
.item-notes,
.header-copy {
  overflow-wrap: anywhere;
}

.quiet-action {
  min-width: 70px;
  min-height: 34px;
  padding: 0 10px;
  background: #f0f2eb;
  color: var(--muted);
  font-size: 0.78rem;
}

.quiet-action:hover {
  background: var(--brand-coral-soft);
  color: #9c3e2f;
}

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

.item-meta span {
  min-height: 30px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #f4f6f0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
}

.item-notes {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.item-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.stepper {
  display: grid;
  grid-template-columns: 38px minmax(42px, 1fr) 38px;
  align-items: center;
  min-height: 40px;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.stepper button {
  width: 38px;
  min-height: 38px;
  border-radius: 0;
  background: transparent;
  color: var(--brand-black);
  font-size: 1.05rem;
}

.stepper button:hover {
  background: var(--brand-blue-soft);
}

.stepper span {
  min-width: 42px;
  text-align: center;
  font-weight: 950;
}

.stock-static {
  display: grid;
  place-items: center;
  min-height: 40px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--brand-sage-soft);
  color: #506d49;
  font-size: 0.82rem;
  font-weight: 950;
}

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

.item-button-group .quiet-action,
.item-button-group .secondary-action {
  width: 100%;
  min-width: 0;
}

.secondary-action {
  min-width: 96px;
  padding: 0 12px;
  background: var(--brand-black);
  color: #ffffff;
}

.category-maker .add-category-action {
  min-width: 0;
  padding: 0 10px;
  width: 100%;
}

.secondary-action:hover {
  background: var(--brand-coral);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 1px dashed rgba(5, 5, 5, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(137, 187, 216, 0.18), transparent),
    linear-gradient(315deg, rgba(155, 122, 188, 0.16), transparent),
    #fbfcf8;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 900;
  text-align: center;
}

@media (max-width: 1060px) {
  .stash-shell {
    padding: 24px;
  }

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

  .brand-intro {
    align-items: flex-start;
  }

  .stash-workspace {
    grid-template-columns: 1fr;
  }

  .header-actions {
    width: 100%;
    justify-items: stretch;
  }

  .header-status {
    max-width: none;
  }

  .stash-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  html,
  body {
    min-width: 0;
  }

  .stash-shell {
    width: 100%;
    padding: 14px;
  }

  .stash-header {
    width: 100%;
    min-height: auto;
    gap: 14px;
    padding: 0 0 16px;
  }

  h1 {
    font-size: 2.25rem;
  }

  .brand-intro {
    width: 100%;
    flex-direction: column;
    gap: 14px;
  }

  .brand-copy,
  .header-copy,
  .header-actions,
  .header-status,
  .account-row,
  .auth-shell,
  .auth-panel,
  .stash-workspace,
  .stash-form,
  .catalog-area,
  .stash-panel,
  .item-grid,
  .stash-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .brand-logo {
    width: min(220px, 72vw);
  }

  .account-row {
    flex-direction: column;
  }

  .signout-action {
    flex-basis: auto;
    width: 100%;
  }

  .auth-shell {
    min-height: auto;
    padding: 4px 0 18px;
  }

  .auth-panel {
    padding: 14px;
  }

  .catalog-toolbar,
  .form-grid,
  .form-grid.three,
  .photo-actions,
  .camera-controls,
  .category-maker,
  .stat-strip {
    grid-template-columns: 1fr;
  }

  .catalog-area,
  .stash-panel {
    padding: 14px;
  }

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

  .stash-card {
    min-height: auto;
  }

  .stash-form input,
  .stash-form select,
  .stash-form textarea,
  .catalog-toolbar input,
  .catalog-toolbar select,
  .camera-action,
  .upload-action,
  .primary-action,
  .secondary-action,
  .quiet-action {
    font-size: 1rem;
  }

  .item-meta span,
  .stat-strip div,
  .empty-state {
    overflow-wrap: anywhere;
  }

  .item-actions {
    align-items: stretch;
  }

  .item-button-group {
    grid-template-columns: 1fr;
  }

  .secondary-action {
    width: 100%;
  }
}
