:root {
  color-scheme: light;
  --paper: #f8f5f0;
  --white: #fffdfa;
  --ink: #271f22;
  --muted: #6f6166;
  --line: #e6dcd7;
  --rose: #792d49;
  --rose-light: #f5e9ed;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, select:focus-visible, .upload:focus-within .drop {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
}
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner, main { width: min(1120px, calc(100% - 72px)); margin-inline: auto; }
.topbar-inner { height: 66px; display: flex; justify-content: space-between; align-items: center; }
.brand {
  color: var(--ink); text-decoration: none; font-weight: 850; font-size: 15px;
  letter-spacing: .15em; white-space: nowrap;
}
.brand span { color: var(--rose); margin-left: .35em; }
.local { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.local i { width: 7px; height: 7px; border-radius: 50%; background: #537952; }
.intro { display: flex; align-items: end; gap: 24px; justify-content: space-between; padding: 48px 0 34px; }
h1 {
  font: normal clamp(46px, 6.7vw, 82px)/.93 Georgia, "Times New Roman", serif;
  letter-spacing: -.075em; margin: 0;
}
.intro p { color: var(--muted); margin: 20px 0 0; line-height: 1.5; }
.intro .secondary { flex: 0 0 auto; margin-bottom: 3px; }
.workspace { display: grid; grid-template-columns: minmax(0, .98fr) minmax(0, 1.02fr); gap: 18px; padding-bottom: 36px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 22px; min-width: 0; }
fieldset { margin: 0; border: 0; padding: 0; min-width: 0; }
.section-title { font-size: 19px; font-weight: 720; letter-spacing: -.02em; margin: 0; padding: 0; }
.upload-grid { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.upload { position: relative; min-width: 0; cursor: pointer; display: block; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.field-title { font-size: 13px; font-weight: 650; display: block; }
.drop {
  height: 170px; display: grid; place-items: center; border: 1px dashed #c9afb8;
  border-radius: 11px; margin-top: 8px; background: #fcf8f8; overflow: hidden;
}
.drop:hover, .drop.dragging { background: var(--rose-light); border-color: var(--rose); }
.upload-empty { display: grid; place-items: center; gap: 8px; color: var(--rose); font-size: 13px; }
.plus {
  width: 33px; height: 33px; display: grid; place-items: center; font-size: 21px;
  line-height: 1; background: var(--rose-light); border-radius: 50%;
}
.drop img, .result-stage img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.file-name { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: 12px; margin-top: 7px; }
.settings { border-top: 1px solid var(--line); margin-top: 19px; padding-top: 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode { grid-column: 1 / -1; }
select {
  margin-top: 6px; height: 39px; width: 100%; background: var(--white); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; font-size: 13px; font-weight: 500;
}
.primary, .secondary {
  border: 1px solid transparent; border-radius: 8px; text-decoration: none; font-size: 13px;
  font-weight: 690; display: inline-flex; gap: 13px; align-items: center; justify-content: center;
  min-height: 38px; padding: 0 13px; cursor: pointer; white-space: nowrap;
}
.primary { width: 100%; min-height: 46px; background: var(--rose); color: #fff; margin-top: 17px; font-size: 14px; }
.primary:hover:enabled { background: #632238; }
.primary:disabled { background: #ead9df; color: #6a4451; cursor: default; }
.secondary { background: var(--white); border-color: var(--line); color: var(--rose); }
.secondary:hover:enabled, a.secondary:hover { border-color: var(--rose); }
.secondary:disabled { opacity: .6; cursor: default; }
.form-help { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.result { display: flex; flex-direction: column; }
.result-header, .result-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.meta { color: var(--muted); font-size: 12px; }
.result-stage {
  position: relative; flex: 1; min-height: 315px; margin-top: 20px;
  background: #eee5e2; border-radius: 11px; display: grid; place-items: center; overflow: hidden;
}
.result-stage img { position: absolute; inset: 0; }
.result-empty { display: grid; place-items: center; gap: 8px; color: #66565c; font-size: 14px; }
.result-mark { width: 37px; height: 49px; border: 1px solid #977582; border-radius: 50% 50% 46% 46%; }
.result-empty p { margin: 0; }
.result-footer { min-height: 38px; margin-top: 12px; }
#status { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
#status[data-kind="error"], #status[data-kind="working"] { color: var(--rose); }
.catalog-panel { margin-bottom: 18px; }
.catalog-header, .admin-collection { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.search { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.search input, .stack input:not([type="checkbox"]) {
  min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); color: var(--ink); font: inherit;
}
.search input { width: 140px; }
.collection, .admin-collection { margin-top: 16px; border-top: 1px solid var(--line); }
.collection h3, .admin-collection h3 { margin: 15px 0 7px; }
.outfits { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 238px), 1fr)); gap: 12px; }
.outfit { padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.outfit h4 { margin: 0 0 9px; }
.outfit > button { margin-top: 10px; }
.pieces, .admin-pieces { display: grid; grid-template-columns: repeat(auto-fit, minmax(75px, 1fr)); gap: 7px; }
.admin-pieces { grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); margin-top: 8px; }
.piece { min-width: 0; padding: 4px; background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; cursor: pointer; }
.piece img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 4px; background: var(--paper); }
.piece span { display: block; padding: 4px 2px; overflow-wrap: anywhere; }
[data-outfit][aria-pressed="true"] { border-color: var(--rose); background: var(--rose-light); }
.owner-upload { width: 100%; margin-top: 8px; }
.consent { display: flex; gap: 7px; align-items: start; margin: 16px 0 6px; font-size: 13px; }
.consent input { accent-color: var(--rose); }
.site-footer { margin-bottom: 24px; }
.admin-page { display: grid; gap: 16px; padding-block: 34px; }
.admin-page h1 { font-size: clamp(36px, 5vw, 58px); }
.admin-page h2 { margin-bottom: 10px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.stack { display: grid; gap: 10px; }
.stack input:not([type="checkbox"]) { display: block; width: 100%; margin-top: 5px; }
.stack .primary { margin-top: 2px; }
.login { max-width: 430px; }
.stats { display: flex; flex-wrap: wrap; gap: 20px; }
.stats dt { color: var(--muted); font-size: 13px; }
.stats dd { margin: 4px 0 0; font-weight: 720; font-size: 20px; }
.usage-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.usage-table th, .usage-table td { border-bottom: 1px solid var(--line); padding: 9px 5px; }
.notice, .stack a { color: var(--rose); }
.admin-collection form { margin-top: 14px; }
.admin-details > summary, .look-references > summary { cursor: pointer; }
.admin-details[open] > summary { margin-bottom: 14px; }
.import-destination, .import-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.import-destination label { flex: 1 1 175px; min-width: 0; }
.import-destination > div { flex: 2 1 350px; }
.import-drop { border: 1px dashed #c9afb8; background: #fcf8f8; padding: 18px; border-radius: 12px; }
.import-drop.dragging { border-color: var(--rose); background: var(--rose-light); }
.import-drop > p, #import-status, .import-card > p { margin: 0; }
.import-drop .import-actions { margin-block: 9px; }
.import-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 12px; }
.import-card { border: 1px solid var(--line); padding: 12px; border-radius: 10px; }
.import-card .meta { overflow-wrap: anywhere; }
.import-image { position: relative; justify-self: center; }
.import-image img { display: block; max-width: 100%; max-height: 210px; height: auto; }
.import-line { position: absolute; inset-inline: 0; border-top: 2px dashed var(--rose); pointer-events: none; }
.look-references { margin-top: 9px; font-size: 13px; color: var(--muted); }
.look-references img { width: auto; max-width: 100%; max-height: 180px; margin: 8px 6px 0 0; border-radius: 6px; }

@media (max-width: 750px) {
  .topbar-inner, main { width: calc(100% - 32px); }
  .intro { padding: 32px 0 24px; align-items: start; flex-direction: column; gap: 15px; }
  .intro p { margin-top: 13px; }
  .workspace { grid-template-columns: 1fr; gap: 12px; }
  .panel { padding: 16px; }
  .catalog-header { flex-direction: column; }
}
@media (max-width: 380px) {
  .drop { height: 127px; }
  .settings { grid-template-columns: 1fr; }
}
@media (min-width: 940px) and (max-height: 820px) {
  .topbar-inner { height: 56px; }
  .intro { padding: 27px 0 23px; }
  h1 { font-size: clamp(44px, 5.4vw, 65px); }
  h1 br { display: none; }
  .intro p { margin-top: 12px; }
  .panel { padding: 18px; }
  .upload-grid, .result-stage { margin-top: 14px; }
  .drop { height: 145px; }
  .settings { margin-top: 15px; padding-top: 13px; }
  .primary { margin-top: 14px; }
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.channel-link, .text-action { color: var(--rose); font-size: 13px; font-weight: 650; }
.channel-link { white-space: nowrap; text-decoration: none; }
.fitting-topbar { width: min(100% - 32px, 680px); gap: 12px; }
.fitting-brand { display: inline-flex; align-items: center; gap: 9px; }
.fitting-brand img { display: block; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.fitting-brand .fitting-brand-name { color: var(--ink); margin-left: 0; }
.fitting-brand-name span { margin-left: 0; }
button.text-action { border: 0; padding: 0; background: none; text-align: left; cursor: pointer; }
.text-action:disabled { opacity: .5; cursor: default; }
.try-on-page, .simple-admin { width: min(100% - 32px, 680px); padding-top: 28px; }
.try-on-page { padding-bottom: 32px; }
.try-on-page h1, .simple-admin h1 { font-size: clamp(38px, 7vw, 58px); letter-spacing: -.06em; }
.fitting-heading { display: flex; align-items: center; gap: clamp(8px, 3vw, 24px); }
.fitting-measure {
  position: relative; flex: 0 0 clamp(56px, 15vw, 100px); height: 33px;
  transform: rotate(-12deg);
}
.fitting-measure::before {
  content: ""; position: absolute; inset: 12px 0 4px; border: 1px solid #c17e90;
  border-radius: 5px 7px 8px 4px;
  background:
    repeating-linear-gradient(90deg, transparent 0 6px, #a55e77 6px 7px) 2px 0 / 100% 4px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 20px, #a55e77 20px 21px) 2px 0 / 100% 8px no-repeat,
    #e8b3c2;
}
.fitting-measure::after {
  content: ""; position: absolute; top: 3px; right: 0; width: 24px; height: 24px;
  border: 1px solid #c17e90; border-radius: 50%;
  background: radial-gradient(circle, #f8f5f0 0 4px, #a55e77 4px 5px, #db9bb0 5px 7px, #efc2cf 7px);
}
.page-hint { color: var(--muted); line-height: 1.45; }
.try-on-page .site-footer { margin: 28px 0 0; }
.reel-search { display: flex; gap: 8px; margin: 22px 0 16px; }
.reel-search input {
  min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 12px; background: var(--white); color: var(--ink); font: inherit;
}
.reel-search .primary { width: auto; margin: 0; }
.reel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 10px; }
.reel-list > p { grid-column: 1 / -1; }
.reel-link {
  display: grid; place-content: center; justify-items: center; gap: 4px; aspect-ratio: 1;
  border: 1px solid #dfccd1; border-radius: 13px; background: #faeef1;
  padding: 6px; color: var(--rose); text-align: center; text-decoration: none;
}
.reel-link:hover, .look-card:hover { border-color: var(--rose); }
.reel-link > span { font-size: 13px; font-weight: 650; }
.reel-link strong { font: 400 clamp(22px, 7vw, 38px)/.95 Georgia, serif; font-variant-numeric: lining-nums; }
.reel-link .reel-number-long { font-size: 23px; }
.back-link { display: inline-block; margin-bottom: 16px; }
.look-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.look-card {
  min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 11px; overflow: hidden;
  background: var(--white); color: var(--ink); text-align: left; cursor: pointer;
}
.look-card:disabled { opacity: .55; cursor: default; }
.look-card img { width: 100%; height: auto; aspect-ratio: 3 / 4; display: block; object-fit: cover; background: var(--rose-light); }
.look-card span { display: block; padding: 9px; font-size: 13px; line-height: 1.3; }
.fitting { display: grid; gap: 12px; margin-top: 20px; scroll-margin-top: 12px; }
.fitting > .text-action { justify-self: start; }
.chosen-look { display: flex; align-items: center; gap: 12px; }
.chosen-look img { border-radius: 8px; object-fit: cover; }
.chosen-look h2 { font-size: 19px; line-height: 1.35; margin: 0; }
.fitting-fields { display: grid; gap: 10px; }
.fitting-fields .consent { margin: 0; }
.fitting-fields .consent a { color: var(--rose); }
.person-picker {
  display: grid; justify-items: center; gap: 8px; border: 1px dashed #c9afb8; border-radius: 10px;
  padding: 16px 10px; background: var(--white); color: var(--rose); cursor: pointer;
}
.person-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.person-picker img { display: block; width: auto; max-width: 100%; max-height: 220px; border-radius: 5px; }
.person-picker:focus-within, .reel-link:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
.fitting .primary { margin: 10px 0 0; }
.result-preview {
  display: block; width: 100%; padding: 0; border: 0; border-radius: 10px;
  background: var(--white); cursor: zoom-in;
}
.fitting-result img { display: block; width: 100%; max-height: 70vh; border-radius: 10px; object-fit: contain; background: var(--white); }
.result-actions { display: grid; justify-items: center; gap: 10px; padding-bottom: 8px; }
.photo-preview {
  inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; border: 0; padding: 0; background: var(--paper); color: var(--ink);
}
.photo-preview-content {
  height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}
.photo-preview-content button { justify-self: start; }
.photo-preview img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
body.photo-preview-open { overflow: hidden; }
.reels-number { width: min(100%, 150px); }
.card-actions { display: grid; gap: 8px; }
.import-caption { font-size: 13px; font-weight: 650; line-height: 1.35; }
.import-edit > summary { cursor: pointer; }
.import-edit > div { margin-top: 8px; }
.import-edit p { margin: 0; }
.import-edit .import-filename { overflow-wrap: anywhere; }
.publish-confirmation { margin: 0 0 12px; }
.simple-admin > .text-action { justify-self: start; }
@media (min-width: 600px) {
  .look-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reel-list { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
}

body:has(.feedback-nav) { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.feedback-nav {
  position: fixed; inset: auto 0 0; z-index: 3; display: flex; justify-content: center;
  background: var(--white); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.feedback-nav button { min-height: 48px; }
.feedback-dialog { width: min(440px, calc(100% - 24px)); max-height: 88dvh; color: var(--ink); }
.feedback-dialog::backdrop { background: rgb(39 31 34 / 48%); }
.feedback-dialog-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.feedback-fields { display: grid; gap: 12px; }
.feedback-fields p, p.feedback-status { margin: 0; }
.feedback-fields button, .feedback-fields a.secondary { justify-self: start; }
.feedback-fields .primary { margin: 0; }
.feedback-fields textarea, .feedback-filter input {
  display: block; width: 100%; margin-top: 5px; padding: 9px; font: inherit; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
}
.feedback-fields textarea { resize: vertical; }
p.feedback-status { margin-top: 8px; color: var(--rose); }
.feedback-status[data-kind="error"] { color: #962e2e; }
.rating-panel { margin-top: 8px; }
.rating-stars { display: flex; flex-wrap: wrap; }
.rating-stars label { position: relative; cursor: pointer; }
.rating-stars input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rating-stars span { display: grid; place-items: center; min-width: 42px; min-height: 42px; color: #84747a; font-size: 30px; border-radius: 6px; }
.rating-stars label:has(input:checked) span, .rating-stars label:has(~ label input:checked) span { color: var(--rose); }
.rating-stars label:has(input:focus-visible) span { outline: 2px solid var(--rose); outline-offset: -2px; }
.feedback-admin { width: min(1050px, calc(100% - 28px)); }
.feedback-metrics, .feedback-analytics, .feedback-filter {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 14px;
}
.feedback-metrics div { padding: 12px; border-radius: 8px; background: var(--rose-light); color: var(--rose); }
.feedback-metrics dd { margin: 4px 0 0; font-size: 24px; font-weight: 700; }
.feedback-analytics h3 { font-size: 15px; }
.feedback-list { font-size: 13px; }
.feedback-list div { display: flex; gap: 8px; justify-content: space-between; margin-block: 4px; }
.feedback-list dd { flex: 0 0 auto; margin: 0; }
.feedback-filter input { min-height: 39px; }
.feedback-entry p { overflow-wrap: anywhere; }
.feedback-entry details form { margin-top: 8px; }
.feedback-message { white-space: pre-wrap; }
.feedback-actions { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
