:root {
  color-scheme: light;
  --bg: #fff4f9;
  --paper: #fffafd;
  --ink: #d73f8c;
  --muted: #e57caf;
  --line: #fac8df;
  --line-strong: #f08fbd;
  --charcoal: #ca2f82;
  --sage: #f08fbd;
  --wine: #d73f8c;
  --pink: #ffaad0;
  --pink-soft: #ffe7f2;
  --rose: #fff7fa;
  --gold: #f4a7ca;
  --wash: #fde6f0;
  --shadow: 0 20px 50px rgba(215, 63, 140, 0.16);
  --headline-font: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #fff9fc 0, var(--bg) 310px, #fff8fb 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

body.locked {
  overflow: hidden;
}

body.locked .app-shell {
  display: none;
}

.access-gate {
  display: none;
}

body.locked .access-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at top left, rgba(255, 194, 220, 0.58), transparent 34%),
    linear-gradient(180deg, #fff9fc 0, #fff4f9 100%);
}

.access-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(100%, 390px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 253, 0.92);
  box-shadow: var(--shadow);
  text-align: center;
}

.access-card .brand-mark {
  margin-bottom: 2px;
}

.access-card h1 {
  font-size: 2rem;
}

.access-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.access-card label {
  width: 100%;
  text-align: left;
}

.access-card input {
  text-align: center;
}

.access-card .primary-button {
  width: 100%;
}

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

button,
label.file-button,
label.icon-button {
  -webkit-tap-highlight-color: transparent;
}

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

h1 {
  margin-bottom: 0;
  font-family: var(--headline-font);
  font-size: clamp(1.9rem, 3.5vw, 3.15rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-family: var(--headline-font);
  font-size: 1rem;
  font-weight: 650;
}

h3 {
  margin-bottom: 0;
  font-family: var(--headline-font);
  font-size: 0.94rem;
  font-weight: 650;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(242, 168, 200, 0.34);
  background: rgba(255, 244, 249, 0.92);
  backdrop-filter: blur(18px);
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.brand-button strong {
  display: block;
  font-size: 1.05rem;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  background:
    linear-gradient(135deg, #ffc2dc, #f05aa4);
  box-shadow: 0 10px 24px rgba(215, 63, 140, 0.2);
}

.brand-mark::before {
  content: "";
  position: absolute;
  top: 7px;
  width: 17px;
  height: 10px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.brand-mark::after {
  content: "N";
  position: absolute;
  bottom: 5px;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

.eyebrow {
  display: block;
  margin: 0 0 4px;
  color: var(--wine);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topnav {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.nav-button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 820;
}

.nav-button.active {
  background: linear-gradient(135deg, #ffc2dc, #f05aa4);
  color: #fff;
  box-shadow: 0 8px 20px rgba(215, 63, 140, 0.18);
}

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

.workspace {
  display: grid;
  grid-template-columns: minmax(250px, 300px) 1fr;
  gap: 24px;
  padding: 24px clamp(18px, 4vw, 48px) 48px;
}

.sidebar {
  position: sticky;
  top: 98px;
  align-self: start;
  display: grid;
  gap: 14px;
}

.panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 28px rgba(215, 63, 140, 0.08);
}

.panel-heading,
.section-heading,
.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading span {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading p,
.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.selected-category {
  margin-bottom: 0;
  font-size: 1.1rem;
  font-weight: 850;
}

.value-panel {
  background: linear-gradient(180deg, #fff, #fff8fb);
}

.value-panel p {
  margin: 0 0 9px;
  color: var(--wine);
  font-size: 0.9rem;
  font-weight: 850;
}

.value-scope-field {
  gap: 6px;
  margin: 0 0 10px;
  font-size: 0.78rem;
}

.value-scope-field select {
  min-height: 36px;
  height: 36px;
  font-size: 0.82rem;
}

.value-category-list {
  display: grid;
  gap: 7px;
}

.value-category-list span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 7px;
  border-top: 1px solid rgba(232, 145, 179, 0.32);
  color: var(--muted);
  font-size: 0.78rem;
}

.value-category-list strong,
.value-category-list em {
  font-style: normal;
  font-weight: 820;
}

.data-panel {
  padding: 13px 14px;
  background: linear-gradient(180deg, #fff, #fff8fb);
}

.data-panel summary {
  color: var(--wine);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 850;
}

.data-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 10px;
}

.data-actions .secondary-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.78rem;
  text-align: center;
}

.cloud-sync {
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.cloud-sync p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.cloud-sync input {
  min-height: 36px;
  height: 36px;
  padding: 0 10px;
  border-color: rgba(250, 200, 223, 0.9);
  font-size: 0.82rem;
}

.cloud-sync > .secondary-button {
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.78rem;
}

.search-label,
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 760;
}

.option-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 760;
}

.option-field > span {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 760;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.material-grid {
  max-height: 138px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(243, 200, 216, 0.75);
  border-radius: 8px;
  background: #fff;
}

.use-grid {
  padding: 2px 0;
}

.type-choice-field {
  grid-column: 1 / -1;
  padding: 8px;
  border: 1px solid rgba(243, 200, 216, 0.75);
  border-radius: 8px;
  background: rgba(255, 250, 253, 0.7);
}

.type-grid {
  max-height: 96px;
  overflow: auto;
  padding-right: 2px;
}

.type-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.type-add-row input {
  min-height: 34px;
  height: 34px;
  font-size: 0.82rem;
}

.type-add-row button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--pink-soft);
  color: var(--wine);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
}

.item-detail-field {
  gap: 6px;
  padding-top: 2px;
}

.item-detail-field > span {
  font-size: 0.76rem;
}

.altered-chip {
  width: fit-content;
  min-height: 28px;
  font-size: 0.72rem;
}

.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--wine);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 850;
}

.check-chip.cover-chip {
  justify-content: center;
  width: 100%;
  min-height: 36px;
  background: #fff8fb;
}

.check-chip input {
  width: 13px;
  min-height: 13px;
  accent-color: var(--wine);
}

.check-chip:has(input:checked) {
  border-color: var(--line-strong);
  background: var(--pink-soft);
  box-shadow: 0 8px 18px rgba(215, 63, 140, 0.1);
}

.search-wrap {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.search-wrap span {
  color: var(--sage);
  font-size: 1.18rem;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 0 11px;
}

select,
.dropdown-input {
  height: 42px;
  line-height: 42px;
  padding-right: 34px;
  appearance: none;
  -webkit-appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--wine) 50%) calc(100% - 17px) 18px / 6px 6px no-repeat,
    linear-gradient(135deg, var(--wine) 50%, transparent 50%) calc(100% - 12px) 18px / 6px 6px no-repeat,
    #fff;
}

.field-grid input,
.field-grid select {
  display: block;
}

select::-ms-expand {
  display: none;
}

.dropdown-input::-webkit-calendar-picker-indicator {
  opacity: 0;
}

textarea {
  resize: vertical;
  padding: 10px 11px;
}

input:focus,
textarea:focus,
select:focus,
.search-wrap:focus-within {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(242, 168, 200, 0.24);
}

.search-wrap input {
  min-height: 42px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.filter-list,
.form-fields {
  display: grid;
  gap: 12px;
}

.filter-list {
  max-height: calc(100vh - 330px);
  overflow: auto;
  padding-right: 2px;
}

.filter-option {
  display: grid;
  gap: 6px;
}

.price-details {
  margin-top: 4px;
  border-top: 1px solid rgba(243, 200, 216, 0.7);
  color: var(--muted);
}

.price-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  cursor: pointer;
  color: var(--wine);
  font-size: 0.83rem;
  font-weight: 850;
  list-style: none;
}

.price-details summary::-webkit-details-marker {
  display: none;
}

.price-details summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pink-soft);
  color: var(--wine);
}

.price-details[open] summary::after {
  content: "−";
}

.price-filter-list {
  display: grid;
  gap: 10px;
  padding: 2px 0 4px;
}

.price-filter {
  display: grid;
  grid-template-columns: 0.9fr 1fr 1fr;
  align-items: end;
  gap: 8px;
}

.price-filter p {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.price-filter label {
  gap: 4px;
  font-size: 0.72rem;
}

.content {
  min-width: 0;
}

.wardrobe-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.overview-pill {
  display: grid;
  gap: 2px;
  min-height: 74px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 253, 0.82);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 24px rgba(215, 63, 140, 0.08);
}

button.overview-pill {
  cursor: pointer;
}

.overview-pill strong {
  font-family: var(--headline-font);
  font-size: 1.55rem;
  font-weight: 650;
  line-height: 1;
  overflow-wrap: anywhere;
}

.overview-pill span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.category-grid {
  display: grid;
  gap: 24px;
}

.category-section {
  display: grid;
  gap: 12px;
}

.category-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(250, 200, 223, 0.75);
}

.category-section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.32rem;
}

.category-section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

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

.category-card {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 220px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(215, 63, 140, 0.1);
}

.category-card:hover,
.item-card:hover,
.outfit-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(215, 63, 140, 0.16);
}

.category-cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 3.4;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 235, 244, 0.95), rgba(246, 182, 209, 0.34)),
    var(--wash);
  color: var(--wine);
  font-weight: 900;
  text-align: center;
}

.category-placeholder {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 18px;
}

.category-placeholder em {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(232, 145, 179, 0.55);
  border-radius: 50%;
  background: rgba(255, 250, 253, 0.86);
  box-shadow: 0 12px 26px rgba(215, 63, 140, 0.14);
  font-size: 1.7rem;
  font-style: normal;
}

.category-cover img,
.item-photo img,
.photo-preview img,
.outfit-photos img,
.picker-item img {
  width: 100%;
  height: 100%;
  object-fit: var(--photo-fit, cover);
  object-position: center center;
  display: block;
}

.category-cover img {
  transform: scale(1.015);
}

.category-meta {
  display: grid;
  gap: 4px;
  padding: 15px;
  background: linear-gradient(180deg, #fff, #fff8fb);
}

.category-meta strong {
  font-size: 1.02rem;
}

.category-meta span {
  color: var(--muted);
  font-size: 0.88rem;
}

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

.quick-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 16px;
}

.quick-filter-row button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--wine);
  cursor: pointer;
  font-weight: 850;
}

.quick-filter-row button.active {
  border-color: var(--line-strong);
  background: var(--pink-soft);
  box-shadow: 0 8px 18px rgba(215, 63, 140, 0.1);
}

.item-card,
.outfit-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 28px rgba(215, 63, 140, 0.1);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.item-card > button,
.outfit-card > button {
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.item-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(253, 232, 240, 0.9), rgba(255, 250, 253, 0.75)),
    var(--wash);
}

.photo-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 24px;
  color: var(--charcoal);
  font-weight: 900;
  text-align: center;
}

.status-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  max-width: calc(100% - 20px);
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 250, 253, 0.94);
  color: var(--wine);
  font-size: 0.72rem;
  font-weight: 850;
}

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

.item-body > span {
  color: var(--wine);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.item-body h3 {
  margin: 0;
  font-family: var(--headline-font);
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.2;
}

.item-body p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 40px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff7fa;
  color: var(--wine);
  font-size: 0.72rem;
  font-weight: 800;
}

.outfit-photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  gap: 2px;
  padding: 2px;
  background:
    linear-gradient(135deg, rgba(255, 236, 245, 0.95), rgba(255, 250, 253, 0.78)),
    var(--wash);
}

.outfit-photos-board {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  align-items: center;
  padding: 8px;
  gap: 6px;
}

.outfit-photos-board img,
.outfit-photos-board span {
  overflow: hidden;
  aspect-ratio: 1 / 1.06;
  border-radius: 8px;
  background: rgba(255, 250, 253, 0.86);
  box-shadow: 0 8px 18px rgba(215, 63, 140, 0.09);
}

.outfit-photos span {
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  padding: 20px;
  color: var(--muted);
  font-weight: 850;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 132px;
  padding: 28px 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 253, 0.72);
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.primary-button,
.secondary-button,
.danger-button,
.text-button,
.icon-button,
.file-button {
  border: 0;
  cursor: pointer;
  font-weight: 850;
}

.primary-button,
.secondary-button,
.danger-button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 8px;
}

.primary-button {
  background: linear-gradient(135deg, #ffc2dc, #f05aa4);
  color: #fff;
  box-shadow: 0 10px 24px rgba(215, 63, 140, 0.2);
}

.secondary-button,
.file-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.danger-button {
  background: rgba(140, 63, 83, 0.12);
  color: var(--wine);
}

.text-button {
  padding: 0;
  background: transparent;
  color: var(--wine);
  font-size: 0.82rem;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--wine);
  font-size: 1.2rem;
}

.dialog {
  width: min(1120px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(77, 35, 61, 0.32);
  backdrop-filter: blur(4px);
}

.dialog form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.dialog-actions > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 18px;
}

.photo-field {
  position: sticky;
  top: 18px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.photo-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(253, 232, 240, 0.9), rgba(255, 255, 255, 0.7)),
    var(--wash);
  color: var(--muted);
  font-weight: 850;
}

.photo-preview.drag-over {
  border-color: var(--line-strong);
  background:
    linear-gradient(135deg, rgba(255, 218, 235, 0.96), rgba(255, 250, 253, 0.86)),
    var(--wash);
  box-shadow: 0 0 0 3px rgba(242, 168, 200, 0.2);
}

.photo-preview img,
.item-photo img,
.outfit-photos img,
.picker-item img {
  transform-origin: center center;
  transform: translate(var(--photo-x, 0), var(--photo-y, 0)) scale(var(--photo-zoom, 1));
}

.photo-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.photo-fit-control {
  gap: 5px;
  font-size: 0.76rem;
}

.photo-fit-control select {
  min-height: 34px;
  height: 34px;
  font-size: 0.8rem;
}

.photo-controls button {
  min-height: 32px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--wine);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 850;
}

.photo-controls button:hover {
  border-color: var(--line-strong);
  background: var(--pink-soft);
}

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

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

.form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(243, 200, 216, 0.85);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.form-section > h3,
.price-box > h3 {
  margin: 0;
  color: var(--wine);
  font-family: var(--headline-font);
  font-size: 1.03rem;
  font-weight: 650;
}

.section-note,
.empty-picker-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.research-section {
  background:
    linear-gradient(135deg, rgba(255, 231, 242, 0.82), rgba(255, 255, 255, 0.74));
}

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

.research-heading h3 {
  margin: 0;
}

.research-heading .secondary-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.78rem;
}

.research-suggestions {
  display: grid;
  gap: 7px;
}

.research-suggestion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(250, 200, 223, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.research-suggestion span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.research-suggestion strong {
  color: var(--wine);
  font-size: 0.76rem;
}

.research-suggestion em {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-suggestion button {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--wine);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 850;
}

.research-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.research-links a {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(250, 200, 223, 0.9);
  border-radius: 999px;
  background: rgba(255, 250, 253, 0.8);
  color: var(--wine);
  font-size: 0.76rem;
  font-weight: 850;
  text-decoration: none;
}

.related-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.related-tools button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffc2dc, #f05aa4);
  color: #fff;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(215, 63, 140, 0.16);
}

.related-tools span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.related-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.related-selected-list:empty {
  display: none;
}

.related-selected-list button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--pink-soft);
  color: var(--wine);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 850;
}

.related-selected-list span {
  font-size: 0.9rem;
}

.price-box {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 245, 249, 0.68);
}

.price-box > h3 {
  font-size: 0.94rem;
}

.price-currency {
  max-width: 150px;
}

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

.price-grid label,
.price-currency {
  gap: 5px;
  font-size: 0.74rem;
}

.price-grid input,
.price-currency select {
  min-height: 34px;
  height: 34px;
  padding: 0 9px;
  border-color: rgba(250, 200, 223, 0.9);
  font-size: 0.82rem;
}

.price-currency select {
  padding-right: 30px;
  background-position:
    calc(100% - 15px) 14px,
    calc(100% - 10px) 14px;
}

.picker-title {
  margin: 0 0 10px;
}

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

.picker-heading .picker-title {
  margin: 0;
}

.picker-heading span {
  color: var(--wine);
  font-size: 0.8rem;
  font-weight: 850;
}

.outfit-selected-list {
  margin-bottom: 10px;
}

.outfit-slot-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.outfit-slot {
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 253, 0.74);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.outfit-slot span {
  font-size: 1.15rem;
}

.outfit-slot strong {
  color: var(--wine);
  font-size: 0.78rem;
}

.outfit-slot em {
  overflow: hidden;
  color: inherit;
  font-size: 0.72rem;
  font-style: normal;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.outfit-slot.filled {
  border-style: solid;
  border-color: var(--line-strong);
  background: linear-gradient(180deg, #fff, var(--pink-soft));
  color: var(--wine);
  box-shadow: 0 8px 18px rgba(215, 63, 140, 0.1);
}

.outfit-slot.active {
  border-style: solid;
  border-color: var(--wine);
  background: linear-gradient(135deg, #ffc2dc, #f05aa4);
  color: #fff;
}

.outfit-slot.active strong,
.outfit-slot.active em {
  color: #fff;
}

.outfit-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  min-height: 190px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(250, 200, 223, 0.9);
  border-radius: 8px;
  background:
    radial-gradient(circle at top left, rgba(255, 194, 220, 0.44), transparent 34%),
    linear-gradient(135deg, #fffafd, #fff1f7);
}

.outfit-board-piece {
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(250, 200, 223, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.outfit-board-piece > button {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid rgba(250, 200, 223, 0.95);
  border-radius: 50%;
  background: rgba(255, 250, 253, 0.92);
  color: var(--wine);
  cursor: pointer;
  font-weight: 900;
}

.outfit-board-photo {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1.1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper);
}

.outfit-board-photo img {
  width: 100%;
  height: 100%;
  object-fit: var(--photo-fit, cover);
  object-position: center center;
  display: block;
}

.outfit-board-photo span {
  font-size: 2rem;
}

.outfit-board-piece strong,
.outfit-board-piece em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outfit-board-piece strong {
  color: var(--wine);
  font-size: 0.8rem;
}

.outfit-board-piece em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
}

.outfit-board-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 164px;
  color: var(--muted);
  text-align: center;
}

.outfit-board-empty span {
  font-size: 2.2rem;
}

.outfit-board-empty strong {
  color: var(--wine);
}

.outfit-board-empty em {
  max-width: 260px;
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.35;
}

.outfit-chooser {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.outfit-picker-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.outfit-picker-filters label {
  gap: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.outfit-picker-filters select {
  min-height: 34px;
  height: 34px;
  padding: 0 30px 0 9px;
  border-color: rgba(250, 200, 223, 0.9);
  background-position:
    calc(100% - 15px) 14px,
    calc(100% - 10px) 14px;
  font-size: 0.8rem;
}

.outfit-search {
  margin-bottom: 10px;
}

.outfit-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  max-height: 430px;
  overflow: auto;
  padding: 2px;
}

.picker-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.picker-item.selected {
  border-color: var(--line-strong);
  background: var(--pink-soft);
  box-shadow: 0 8px 18px rgba(215, 63, 140, 0.1);
}

.picker-item input {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 18px;
  min-height: 18px;
  accent-color: var(--wine);
}

.picker-item span {
  overflow: hidden;
  aspect-ratio: 1 / 1.08;
  border-radius: 8px;
  background: var(--paper);
}

.picker-item strong,
.picker-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-item em {
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
}

.picker-item strong {
  color: var(--wine);
  font-size: 0.78rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding-bottom: 12px;
  }

  .topnav {
    justify-content: stretch;
  }

  .nav-button {
    flex: 1;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions .primary-button {
    flex: 1;
  }

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

  .content {
    order: 1;
  }

  .sidebar {
    position: static;
    order: 2;
  }

  .filter-list {
    max-height: none;
  }

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

  .photo-field {
    position: static;
  }

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

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

@media (max-width: 640px) {
  .topbar {
    gap: 12px;
    padding: 14px 14px 12px;
  }

  .brand-button strong {
    font-size: 0.98rem;
  }

  .workspace {
    padding: 16px 14px calc(34px + env(safe-area-inset-bottom));
  }

  .topnav {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .nav-button {
    min-width: max-content;
  }

  .section-heading,
  .dialog-header,
  .dialog-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions > div,
  .dialog-actions button {
    width: 100%;
  }

  .form-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

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

  .outfit-slot-rail,
  .outfit-picker-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-field {
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
    align-items: end;
  }

  .photo-preview {
    width: 100%;
  }

  .file-button {
    align-self: end;
  }

  .category-row,
  .items-grid,
  .outfits-grid {
    grid-template-columns: 1fr;
  }

  .wardrobe-overview {
    grid-template-columns: 1fr 1fr;
  }

  .related-tools {
    grid-template-columns: 1fr auto;
  }

  .related-tools span {
    grid-column: 1 / -1;
  }

  .price-currency {
    max-width: none;
  }
}
