@font-face {
  font-family: Inter;
  src: url("./assets/inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Studio Serif";
  src: url("./assets/studio-serif.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: Inter, system-ui, sans-serif;
  --serif: "Studio Serif", Georgia, serif;
  --paper: #faf8f5;
  --surface: #fffdfa;
  --ink: #302631;
  --muted: #6d646c;
  --line: #e7e0db;
  --line-strong: #dcd2ce;
  --accent: #4b3147;
  --accent-hover: #61445d;
  --tint: #f2eaf0;
  --accent-soft: #e6d5e2;
  --sage-text: #365747;
  --shadow: 0 1px 2px #462d3c08;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 14px; }
body:has(dialog[open]) { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button, summary, select { cursor: pointer; }
button:disabled { opacity: .47; cursor: default; }
button { color: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }
svg { display: block; flex: 0 0 auto; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #906b8e; outline-offset: 3px; }
h1:focus, #main:focus { outline: none; }

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

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 20;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 7px;
  background: var(--accent);
  color: white;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  border-bottom: 1px solid var(--line);
  background: #fefcf9;
}
.header-inner {
  max-width: 1640px;
  min-height: 72px;
  margin: auto;
  padding: 0 42px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.wordmark {
  justify-self: start;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  white-space: nowrap;
  font: 400 29px/1 var(--serif);
  letter-spacing: -.025em;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff9fb;
  display: grid;
  place-items: center;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f3efeb;
}
.segmented > * {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}
.segmented > *:hover { color: var(--accent); }
.segmented > [aria-current], .segmented > [aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent);
  border-color: #e8dfdf;
  box-shadow: 0 1px 3px #3423330b;
  font-weight: 650;
}
.main-nav > * { min-width: 93px; padding-inline: 14px; }
.main-nav > * > span { display: inline-flex; }

.header-end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 16px;
}
.source-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: -.012em;
  white-space: nowrap;
}
.source-label > span { width: 6px; height: 6px; border-radius: 50%; background: #a1819c; }

.icon-button {
  width: 35px;
  min-width: 35px;
  height: 35px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  background: transparent;
  color: var(--muted);
}
.icon-button:hover:not(:disabled), .icon-button[aria-pressed="true"] {
  color: var(--accent);
  background: var(--tint);
}
.settings-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  border-color: var(--line);
  background: var(--surface);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 635;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.button.primary { background: var(--accent); color: #fffafc; border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.button.secondary:hover:not(:disabled), .button.secondary[aria-expanded="true"] {
  background: #f9f3f7;
  border-color: #d7c4d2;
  color: var(--accent);
}
.button.plain { color: var(--muted); background: transparent; }
.button.plain:hover { background: #f5efec; color: var(--ink); }
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--accent);
  min-height: 28px;
  padding: 3px 5px;
  font-size: 12px;
  font-weight: 600;
}
.text-button:hover { background: var(--tint); }

.page {
  width: min(calc(100% - 88px), 1232px);
  margin: 0 auto;
  padding: 43px 0 58px;
}
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-heading h1 {
  margin: 0;
  font: 400 clamp(46px, 5vw, 65px)/1.02 var(--serif);
  letter-spacing: -.045em;
}
.page-summary { margin-top: 9px; color: var(--muted); font-size: 13px; }
.new-button { font-size: 13px; min-height: 44px; padding-inline: 16px; }
.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 30px;
  margin-bottom: 20px;
}
.gallery-controls, .wardrobe-controls { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gallery-controls .search-field { width: min(280px, 31vw); }

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  padding: 0 11px;
  color: var(--muted);
}
.search-field:focus-within {
  border-color: #aa88a5;
  box-shadow: 0 0 0 2px #a991a226;
}
.search-field input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  min-height: 36px;
  padding: 0;
}
.search-field input::placeholder { color: var(--muted); opacity: 1; }
.search-field input:focus-visible { outline: none; }
.filter-anchor { position: relative; flex: 0 0 auto; }
.filter-button { padding-inline: 12px; }
.filter-count {
  min-width: 18px;
  height: 18px;
  padding-inline: 4px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
}
.filter-popover {
  position: absolute;
  z-index: 12;
  top: calc(100% + 8px);
  left: 0;
  width: 355px;
  max-width: calc(100vw - 32px);
  padding: 13px 15px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: 0 14px 34px #38283724;
  border-radius: 12px;
}
.popover-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.popover-header strong { font-size: 13px; }
.filter-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filter-field { display: grid; gap: 5px; font-size: 11px; font-weight: 650; color: var(--muted); min-width: 0; }
.preview-toggle { flex: 0 0 auto; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 21px; }
.outfit-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow);
  transition: border-color .16s, box-shadow .16s;
}
.outfit-card:hover {
  border-color: #cdbac8;
  box-shadow: 0 5px 18px #432f3d10;
}
.outfit-card-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: inherit;
}
.outfit-card-image {
  position: relative;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.canvas-preview {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--canvas-color);
  overflow: hidden;
}
.preview-piece, .canvas-piece { position: absolute; }
.preview-piece img, .canvas-piece img { width: 100%; height: 100%; object-fit: contain; }
.preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: #5e5261;
}
.gallery-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ede7e1;
}
.card-status { position: absolute; top: 12px; right: 12px; }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #e7ded9;
  border-radius: 6px;
  background: #fffcf5;
  color: #5c5159;
  font-size: 10.5px;
  font-weight: 625;
  line-height: 1;
  white-space: nowrap;
}
.status-badge.tested { background: #edf3e9; border-color: #dbe6d7; color: var(--sage-text); }
.status-badge.draft { background: #f4ebf4; border-color: #e6d9e6; color: #694a66; }
.outfit-card-caption {
  min-height: 88px;
  padding: 13px 16px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
}
.outfit-card-text { min-width: 0; }
.outfit-card-caption h2 {
  font: 400 26px/1.1 var(--serif);
  letter-spacing: -.028em;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}
.outfit-card-caption h2:last-child { margin-bottom: 0; }
.card-arrow {
  flex: 0 0 33px;
  height: 33px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  display: grid;
  place-items: center;
  transition: background .15s, border-color .15s;
}
.outfit-card-button:hover .card-arrow { background: var(--tint); border-color: #dcc9d9; }
.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid #ece5e0;
  border-radius: 5px;
  background: #f5f1ed;
  color: #615561;
  font-size: 10.5px;
  font-weight: 525;
  line-height: 1.16;
}
.no-results {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 64px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}
.no-results h2 { color: var(--ink); font: 400 29px/1.1 var(--serif); margin: 0; }
.no-results .button { margin-top: 5px; }

.editor-page { width: min(calc(100% - 64px), 1544px); padding-top: 26px; }
.editor-heading { margin-bottom: 21px; }
.editor-heading h1 { font-size: clamp(36px, 4vw, 49px); }
.editor-heading-actions { display: flex; align-items: center; gap: 12px; }
.autosave-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 1px;
  color: #5c6b60;
  font-size: 11px;
  font-weight: 550;
}
.autosave-status.save-warning { color: #9a3e45; }
.mobile-editor-nav { display: none; }
.editor-grid {
  display: grid;
  grid-template-columns: minmax(205px, .89fr) minmax(365px, 2.42fr) minmax(269px, 1fr);
  align-items: start;
  gap: 16px;
}
.editor-center { min-width: 0; }
.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.wardrobe-panel, .details-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100dvh - 169px);
  display: flex;
  flex-direction: column;
}
.sidebar-heading, .canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 15px 12px;
  min-height: 51px;
}
.sidebar-heading h2, .canvas-header h2, .pieces-heading h2, .notes-panel label {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 675;
  letter-spacing: -.02em;
}
.count-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 550;
  white-space: nowrap;
}
.wardrobe-controls { align-items: stretch; padding: 0 12px 13px; }
.wardrobe-controls .filter-icon { width: 37px; padding: 0; position: relative; }
.filter-icon .filter-count { position: absolute; right: -5px; top: -5px; }
.wardrobe-controls .search-field { flex: 1; min-width: 0; padding-inline: 7px; min-height: 37px; gap: 5px; }
.wardrobe-controls .search-field input { font-size: 11.5px; min-height: 34px; }
.wardrobe-controls .filter-button { min-height: 37px; }
.wardrobe-panel .filter-popover { width: 275px; }
.wardrobe-groups {
  border-top: 1px solid var(--line);
  padding: 0 12px 10px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #d9cdd5 transparent;
}
.wardrobe-group + .wardrobe-group { border-top: 1px solid #eee8e4; }
.wardrobe-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 0 1px;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink);
}
.wardrobe-group summary::-webkit-details-marker { display: none; }
.wardrobe-group summary svg { color: var(--muted); }
.wardrobe-group[open] summary svg { transform: rotate(180deg); }
.group-count { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 500; }
.wardrobe-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding-bottom: 10px;
}
.garment-card {
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #ebe4df;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  text-align: left;
  cursor: grab;
}
.garment-card:hover { border-color: #cdb7ca; }
.garment-card:active { cursor: grabbing; }
.garment-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: clamp(71px, 7vw, 105px);
  background: #f2eeeb;
  padding: 8px 9px;
  pointer-events: none;
}
.garment-tile img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}
.garment-add {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 19px;
  height: 19px;
  border: 1px solid #e9dedf;
  border-radius: 5px;
  background: #fffdf9;
  color: var(--accent);
  display: grid;
  place-items: center;
}
.garment-card:hover .garment-add { background: var(--accent); color: #fff; }
.garment-name {
  min-height: 30px;
  padding: 5px 5px 6px;
  display: flex;
  align-items: center;
  width: 100%;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 575;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.wardrobe-empty { padding: 18px 0; font-size: 12px; color: var(--muted); }

.canvas-header { padding: 8px 12px 8px 15px; }
.canvas-tools, .layer-toolbar { display: inline-flex; align-items: center; gap: 2px; }
.canvas-tools .icon-button, .layer-toolbar .icon-button { width: 29px; min-width: 29px; height: 29px; }
.canvas-tools .icon-button svg, .layer-toolbar .icon-button svg { width: 16px; height: 16px; }
.canvas-tools output { min-width: 40px; text-align: center; font-size: 11px; font-weight: 650; color: var(--ink); }
.toolbar-divider { height: 16px; width: 1px; background: var(--line); margin: 0 3px; }
.canvas-inset { padding: 0 10px; }
.canvas-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid #dfd7d0;
  border-radius: 8px;
  background-color: #eae3dd;
  background-image: radial-gradient(#bcb0b8 1px, transparent 1px);
  background-size: 12px 12px;
  touch-action: none;
  user-select: none;
}
.canvas-viewport.is-drop-target { box-shadow: 0 0 0 2px #966c91; }
.canvas-artboard { position: absolute; inset: 0; isolation: isolate; }
.canvas-viewport.can-pan, .canvas-viewport.can-pan * { cursor: grab; }
.canvas-viewport.is-panning, .canvas-viewport.is-panning * { cursor: grabbing; }
.canvas-piece {
  appearance: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: move;
}
.canvas-piece:focus-visible { outline-offset: 3px; }
.canvas-piece img { pointer-events: none; }
.canvas-selection {
  position: absolute;
  outline: 1px solid #8d5f88;
  z-index: 1;
  pointer-events: none;
}
.resize-handle {
  width: 9px;
  height: 9px;
  position: absolute;
  border: 1px solid #84517d;
  background: #fcf8fb;
  border-radius: 1px;
  pointer-events: auto;
}
.resize-handle.nw { top: -4px; left: -4px; cursor: nwse-resize; }
.resize-handle.ne { top: -4px; right: -4px; cursor: nesw-resize; }
.resize-handle.sw { bottom: -4px; left: -4px; cursor: nesw-resize; }
.resize-handle.se { bottom: -4px; right: -4px; cursor: nwse-resize; }

.canvas-empty, .detail-media-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #493c48;
  text-align: center;
  pointer-events: none;
  padding: 16px;
}
.canvas-empty strong { font: 400 34px/1.1 var(--serif); letter-spacing: -.03em; margin-top: 15px; }
.canvas-empty > span:last-child { font-size: 12px; margin-top: 7px; color: #5e525c; }
.empty-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  color: var(--accent);
  background: #fffcf9a8;
  border: 1px solid #ddd2d7;
  border-radius: 15px;
}
.canvas-artboard.is-ink .canvas-empty *, .canvas-preview.is-ink .preview-empty { color: #faf1fa; }
.canvas-artboard.is-ink .empty-symbol { background: #4b3d52; border-color: #7b6079; }
.canvas-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 54px;
  gap: 6px 10px;
  padding: 8px 13px;
}
.background-control {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.swatch-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 2px; }
.swatch {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid #d8cdd4;
  border-radius: 50%;
  background: var(--swatch);
  color: var(--accent);
}
.swatch svg { visibility: hidden; }
.swatch:hover { border-color: #a7829f; }
.swatch[aria-pressed="true"] { outline: 1px solid #875e83; outline-offset: 2px; }
.swatch[aria-pressed="true"] svg { visibility: visible; }
.swatch[data-background="ink"], .swatch[data-default-background="ink"] { color: #fff7fc; }
.layer-toolbar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf6f7;
  padding: 1px 2px;
}
.layer-toolbar [data-layer="remove"] { color: #973f58; }

.canvas-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.notes-panel, .pieces-panel { padding: 13px 14px; min-height: 135px; }
.notes-panel label { display: block; margin-bottom: 10px; }
.notes-panel textarea {
  display: block;
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 9px;
  font-size: 12px;
  line-height: 1.45;
}
.pieces-heading { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.pieces-list, .detail-pieces { list-style: none; margin: 8px 0 0; padding: 0; }
.pieces-list { max-height: 157px; overflow: auto; scrollbar-width: thin; }
.pieces-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
  border-radius: 6px;
}
.pieces-row + .pieces-row { margin-top: 2px; }
.pieces-row.is-selected { background: #f3eaf2; }
.piece-link {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  text-align: left;
  min-height: 31px;
  min-width: 0;
  flex: 1;
  padding: 2px 4px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 11px;
}
.piece-link span:last-child { overflow-wrap: anywhere; }
.pieces-row .icon-button { width: 26px; min-width: 26px; height: 26px; }
.pieces-row svg { width: 14px; height: 14px; }
.piece-link:hover { color: #855e7c; }
.piece-thumb, .detail-piece-thumb {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  background: #f4efeb;
  border-radius: 4px;
  padding: 3px;
}
.piece-thumb img, .detail-piece-thumb img { width: 100%; height: 100%; object-fit: contain; }

.details-panel .sidebar-heading { border-bottom: 1px solid var(--line); }
.details-fields {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px 13px;
  scrollbar-width: thin;
  scrollbar-color: #d9cdd5 transparent;
}
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .form-section h3, .status-field legend {
  font-size: 12px;
  font-weight: 650;
  margin: 0;
}
input[type="text"], textarea, select {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}
input[type="text"], select { width: 100%; min-height: 36px; padding: 6px 8px; font-size: 12px; }
input[type="text"]::placeholder, textarea::placeholder { color: #756970; opacity: 1; }
select {
  appearance: none;
  padding-right: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%236d646c' stroke-width='1.35' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 7px center;
  background-size: 14px;
  background-repeat: no-repeat;
}
.form-section { border-top: 1px solid var(--line); padding: 11px 0 0; margin: 11px 0 0; }
.tag-field, .status-field { min-width: 0; border: 0; padding: 0; margin: 0; }
.tag-field + .tag-field { margin-top: 8px; }
.tag-field legend { padding: 0; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 625; }
.tag-button { background: var(--surface); border-color: var(--line-strong); }
.tag-button:hover { background: #f7eff5; border-color: #cdb7c9; }
.tag-button[aria-pressed="true"] { background: var(--tint); border-color: #d8bed2; color: var(--accent); font-weight: 650; }
.status-field { margin-top: 13px; padding-top: 6px; }
.status-field legend { padding: 0; }
.status-options { display: flex; gap: 5px; flex-wrap: wrap; }
.status-options label { position: relative; flex: 1 0 auto; }
.status-options input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  width: 100%;
  cursor: pointer;
}
.status-options label > span {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  min-height: 30px;
  padding: 2px 6px;
  font-size: 10.5px;
  font-weight: 550;
  color: var(--muted);
  background: var(--surface);
}
.status-options input:checked + span { border-color: #d9c5d4; background: var(--tint); color: var(--accent); font-weight: 650; }
.status-options input:focus-visible + span { outline: 2px solid #906b8e; outline-offset: 2px; }
.upload-section h3 { margin-bottom: 7px; }
.upload-button { width: 100%; justify-content: flex-start; min-height: 35px; padding-inline: 8px; font-size: 11.5px; }
.field-hint { font-size: 11px; color: var(--muted); line-height: 1.42; }
.upload-section .field-hint { margin-top: 6px; }
.editor-media { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 7px; }
.new-collection { display: flex; align-items: stretch; gap: 5px; margin-top: 6px; }
.new-collection .button { min-height: 35px; }
.editor-actions {
  border-top: 1px solid var(--line);
  padding: 10px 12px 4px;
  background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
  flex: 0 0 auto;
}
.save-actions { display: grid; grid-template-columns: 1fr 1.17fr; gap: 6px; }
.save-actions .button { min-height: 37px; padding-inline: 7px; font-size: 11.5px; }
.reset-button { display: flex; margin: 3px auto 0; color: var(--muted); font-size: 10.5px; }

.dialog {
  padding: 0;
  width: min(850px, calc(100% - 34px));
  max-width: none;
  max-height: min(830px, calc(100dvh - 40px));
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  color: var(--ink);
  box-shadow: 0 24px 100px #2d1e31a0;
  scrollbar-width: thin;
}
.dialog::backdrop { background: #30263373; backdrop-filter: blur(3px); }
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  padding: 17px 20px;
}
.dialog-header h2 { margin: 0; font: 400 34px/1.06 var(--serif); letter-spacing: -.026em; overflow-wrap: anywhere; }
.dialog-header .icon-button { flex: 0 0 auto; }
.outfit-dialog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 16px 21px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.detail-statuses { display: flex; gap: 5px; margin-bottom: 6px; }
.detail-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.detail-actions .button { min-height: 36px; }
.outfit-dialog-body { padding: 18px 22px 23px; }
.detail-visuals { display: grid; grid-template-columns: 1.6fr 1fr; align-items: stretch; gap: 14px; }
.detail-canvas { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.detail-media {
  position: relative;
  min-width: 0;
  padding: 10px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcf9f6;
}
.detail-media h3, .detail-section h3, .settings-row h3 { margin: 0 0 9px; font-size: 12.5px; font-weight: 675; }
.detail-media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.detail-media-grid:has(> :only-child) { grid-template-columns: 1fr; }
.detail-media-grid > .media-tile:only-child .media-thumb { aspect-ratio: 4 / 5; max-height: 302px; }
.detail-media-grid > .media-tile:only-child img { object-fit: contain; }
.detail-media-empty { gap: 6px; position: static; min-height: 115px; font-size: 11px; color: var(--muted); }
.media-tile { position: relative; min-width: 0; }
.media-thumb {
  width: 100%;
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eee8e5;
  color: var(--accent);
  overflow: hidden;
  padding: 0;
}
.media-thumb:hover { border-color: #a480a1; }
.media-thumb img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.media-tile .icon-button {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 20px;
  width: 20px;
  height: 20px;
  background: var(--surface);
  color: var(--accent);
  border-radius: 5px;
}
.media-tile .icon-button svg { width: 12px; height: 12px; }
.detail-section { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 13px; }
.detail-section h3 { display: flex; align-items: center; gap: 7px; }
.detail-pieces { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 14px; }
.detail-pieces li { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.detail-piece-thumb { width: 30px; height: 30px; }
.detail-text { display: flex; align-items: center; gap: 6px; }
.detail-text, .detail-notes { font-size: 12.5px; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.detail-notes { white-space: pre-wrap; }

.compact-dialog { width: min(466px, calc(100% - 34px)); }
.compact-dialog .dialog-header { border-bottom: 1px solid var(--line); }
.compact-dialog .dialog-header h2 { font-size: 30px; }
.dialog-copy { padding: 15px 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.dialog-actions { padding: 4px 19px 17px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.settings-content { padding: 4px 20px 16px; }
.settings-row { padding: 12px 0; }
.settings-row + .settings-row { border-top: 1px solid var(--line); }
.settings-row p { margin-bottom: 5px; }
.media-dialog { width: min(670px, calc(100% - 34px)); overflow: auto; }
.media-dialog .dialog-header { border-bottom: 1px solid var(--line); }
.media-dialog .dialog-header h2 { font: 650 15px/1.2 Inter, sans-serif; letter-spacing: -.01em; }
.attachment-frame {
  background: #f2ede8;
  color: var(--muted);
  display: grid;
  place-items: center;
  min-height: 160px;
}
.attachment-frame img, .attachment-frame video {
  display: block;
  max-width: 100%;
  max-height: min(660px, calc(100dvh - 168px));
  object-fit: contain;
}
.media-nav { display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); padding: 6px; font-size: 12px; }

.toast {
  position: fixed;
  z-index: 25;
  bottom: 17px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 34px);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fffafc;
  border: 1px solid #694d63;
  border-radius: 9px;
  box-shadow: 0 6px 25px #30253230;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.4;
}
.toast.is-error { background: #853c50; border-color: #97445a; }

@media (max-width: 1100px) {
  .header-inner { padding-inline: 28px; }
  .page { width: calc(100% - 56px); }
  .editor-page { width: calc(100% - 36px); }
  .editor-grid { grid-template-columns: minmax(176px, .85fr) minmax(324px, 2.08fr) minmax(239px, 1.04fr); gap: 12px; }
  .gallery-grid { gap: 15px; }
  .outfit-card-caption { padding: 11px 12px 13px; min-height: 83px; }
  .outfit-card-caption h2 { font-size: 23px; }
}

@media (max-width: 850px) {
  .header-inner { padding-inline: 20px; }
  .page { width: calc(100% - 40px); padding-top: 30px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-grid { grid-template-columns: minmax(170px, 1fr) minmax(290px, 2.55fr); }
  .mobile-editor-nav { display: flex; gap: 5px; margin-bottom: 12px; }
  .mobile-editor-nav .button { min-height: 32px; }
  .details-panel { grid-column: 1 / -1; position: static; max-height: none; }
  .wardrobe-panel { max-height: min(680px, calc(100dvh - 30px)); }
  .details-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
  }
  .details-fields .form-section { margin-top: 0; padding-top: 0; border: 0; }
  .details-fields .tags-section { grid-area: 1 / 2 / 4 / 3; }
  .details-fields .collection-section { grid-column: 1; }
  .save-actions { display: flex; justify-content: flex-end; }
  .save-actions .button { padding-inline: 12px; }
  .source-label { display: none; }
}

@media (max-width: 565px) {
  .header-inner { padding: 9px 12px; min-height: 58px; gap: 7px; }
  .wordmark { font-size: 21px; gap: 5px; }
  .brand-mark { width: 27px; height: 27px; border-radius: 7px; }
  .brand-mark svg { width: 18px; height: 18px; }
  .main-nav { gap: 1px; padding: 2px; }
  .main-nav > * { min-width: auto; padding: 0 6px; min-height: 28px; font-size: 11px; }
  .main-nav svg { display: none; }
  .settings-button { width: 31px; min-width: 31px; height: 31px; }
  .page { width: calc(100% - 24px); padding-top: 24px; }
  .page-heading h1 { font-size: clamp(36px, 9vw, 47px); }
  .new-button { padding-inline: 8px; min-height: 38px; font-size: 11.5px; }
  .new-button svg { width: 15px; height: 15px; }
  .page-summary { font-size: 11.5px; margin-top: 5px; }
  .gallery-toolbar { gap: 8px; flex-wrap: wrap; margin-top: 19px; margin-bottom: 12px; }
  .gallery-controls { flex: 1 0 100%; }
  .gallery-controls .search-field { width: auto; flex: 1; }
  #gallery-filter-panel { left: auto; right: 0; }
  .preview-toggle { margin-left: auto; }
  .gallery-grid { gap: 9px; }
  .outfit-card { border-radius: 10px; }
  .outfit-card-image { border-radius: 9px 9px 0 0; }
  .outfit-card-caption { padding: 8px 7px 9px; min-height: 73px; }
  .outfit-card-caption h2 { font-size: 19px; margin-bottom: 5px; }
  .outfit-card-caption .tag-pill { font-size: 9px; min-height: 17px; padding-inline: 4px; }
  .outfit-card-caption .tag-row { gap: 3px; }
  .card-arrow { flex-basis: 23px; height: 23px; }
  .card-arrow svg { width: 13px; height: 13px; }
  .card-status { top: 5px; right: 5px; }
  .status-badge { min-height: 18px; padding: 2px 4px; font-size: 9.5px; }
  .status-badge svg { width: 12px; height: 12px; }
  .editor-heading { flex-wrap: wrap; justify-content: space-between; margin-bottom: 11px; }
  .editor-heading h1 { font-size: 35px; }
  .editor-heading-actions { gap: 6px; flex-wrap: wrap; }
  .editor-heading-actions .button { min-height: 32px; padding-inline: 7px; font-size: 11px; }
  .autosave-status { font-size: 10px; }
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .editor-center { grid-row: 1; }
  .wardrobe-panel { max-height: 500px; }
  .wardrobe-panel, .details-panel { position: static; }
  .wardrobe-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .canvas-empty strong { font-size: 26px; margin-top: 9px; }
  .canvas-empty > span:last-child { font-size: 11px; }
  .canvas-empty .empty-symbol { width: 43px; height: 43px; }
  .canvas-empty .empty-symbol svg { width: 25px; height: 25px; }
  .details-fields { display: block; }
  .details-fields .form-section { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 9px; }
  .outfit-dialog-header { flex-wrap: wrap; padding: 11px 13px; gap: 7px; }
  .outfit-dialog-header h2 { font-size: 30px; }
  .detail-actions { margin-left: auto; }
  .outfit-dialog-body { padding: 11px 13px 17px; }
  .detail-visuals { grid-template-columns: 1.5fr 1fr; gap: 6px; }
  .detail-media { padding: 6px; }
  .detail-media-grid { grid-template-columns: 1fr; gap: 5px; }
  .detail-media-empty { padding: 7px 1px; min-height: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
