.fit-dialog {
  --fit-ink: #222220;
  --fit-muted: #666560;
  --fit-line: #dcdad4;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(880px, calc(100% - 42px));
  max-width: none;
  max-height: min(86vh, 780px);
  max-height: min(86dvh, 780px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(43, 39, 31, .12);
  border-radius: 22px;
  background: #faf9f6;
  color: var(--fit-ink);
  box-shadow: 0 32px 100px rgba(30, 26, 20, .22);
  font: 400 16px/1.55 -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Thonburi', Tahoma, sans-serif;
  text-align: left;
  overscroll-behavior: contain;
}
.fit-dialog::backdrop { background: rgba(29, 28, 25, .49); backdrop-filter: blur(6px); }
.fit-dialog *, .fit-dialog *::before, .fit-dialog *::after { box-sizing: border-box; }
.fit-dialog [hidden] { display: none !important; }
.fit-dialog h2, .fit-dialog h3, .fit-dialog p { margin: 0; }
.fit-dialog button, .fit-dialog input { font: inherit; }
.fit-dialog button { cursor: pointer; }
.fit-dialog button:disabled { opacity: .55; cursor: progress; }
.fit-dialog :focus-visible { outline: 2px solid #805a43; outline-offset: 3px; }
.fit-shell { padding: clamp(20px, 4vw, 38px); }
.fit-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 0 0 24px; }
.fit-head h2 { font-size: clamp(1.65rem, 3vw, 2.1rem); font-weight: 550; line-height: 1.3; letter-spacing: -.04em; }
.fit-head .fit-label { margin-top: 4px; font-size: .9rem; color: var(--fit-muted); overflow-wrap: anywhere; }
.fit-close { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--fit-line); border-radius: 50%; background: #fff; color: var(--fit-ink); padding: 10px; }
.fit-close:hover { background: #eeece7; }
.fit-close svg { width: 18px; height: 18px; }
.fit-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(210px, .85fr); gap: clamp(20px, 4vw, 38px); align-items: start; }
.fit-stage { display: grid; place-items: center; position: relative; overflow: hidden; width: 100%; aspect-ratio: 1.03; border: 1px solid #e6e2d9; border-radius: 13px; background: #eeece7; }
.fit-stage:has(.fit-preview:focus-visible) { outline: 2px solid #805a43; outline-offset: 3px; }
.fit-empty { display: grid; place-items: center; gap: 19px; font-size: .875rem; color: #686660; }
.fit-target { width: clamp(80px, 11vw, 126px); aspect-ratio: 1.3; display: grid; place-items: center; color: #67645d; background: linear-gradient(#a49f92, #a49f92) left top / 14px 1px, linear-gradient(#a49f92, #a49f92) left top / 1px 14px, linear-gradient(#a49f92, #a49f92) right top / 14px 1px, linear-gradient(#a49f92, #a49f92) right top / 1px 14px, linear-gradient(#a49f92, #a49f92) left bottom / 14px 1px, linear-gradient(#a49f92, #a49f92) left bottom / 1px 14px, linear-gradient(#a49f92, #a49f92) right bottom / 14px 1px, linear-gradient(#a49f92, #a49f92) right bottom / 1px 14px; background-repeat: no-repeat; }
.fit-target svg { width: 42%; }
.fit-preview { display: block; position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y pinch-zoom; cursor: crosshair; }
.fit-watch-clip { pointer-events: none; position: absolute; overflow: hidden; }
.fit-watch-position { position: absolute; }
.fit-watch-grip { position:absolute; transform:translate(-50%,-50%); border-radius:32%; pointer-events:auto; touch-action:none; cursor:grab; }
.fit-watch-grip:active { cursor:grabbing; }
.fit-skin-contact, .fit-band-wrap, .fit-edge-shading { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fit-watch, .fit-watch-position > [data-watch-backup] { display: block; width: 100%; height: 100%; mask-image: var(--fit-watch-mask, none); -webkit-mask-image: var(--fit-watch-mask, none); mask-size: 100% 100%; -webkit-mask-size: 100% 100%; }
.fit-side { align-self: center; min-width: 0; }
.fit-intro h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -.03em; }
.fit-intro p { margin: .4rem 0 1.3rem; color: var(--fit-muted); font-size: 1rem; line-height: 1.55; }
.fit-upload, .fit-save { border: 1px solid transparent; border-radius: 30px; min-height: 45px; padding: 10px 19px; line-height: 1.3; font-weight: 550; }
.fit-primary { background: var(--fit-ink); color: white; }
.fit-primary:hover { background: #41403b; }
.fit-secondary { background: transparent; border: 1px solid #bdb9b1; color: var(--fit-ink); }
.fit-secondary:hover { background: #eeece7; }
.fit-side .fit-filetype, .fit-side .fit-note, .fit-side .fit-message { color: var(--fit-muted); font-size: .813rem; line-height: 1.55; }
.fit-side .fit-filetype { margin-top: 12px; }
.fit-side .fit-note { margin: 12px 0 20px; }
.fit-message:empty { display: none; }
.fit-side .fit-message:not(:empty) { margin-top: 15px; }
.fit-rule { height: 1px; background: var(--fit-line); margin: 20px 0; }
.fit-range-head { display: flex; justify-content: space-between; gap: 8px; font-size: .9375rem; }
.fit-range-head output { color: var(--fit-muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.fit-range { display: block; width: 100%; padding: 0; margin: 4px 0 10px; height: 26px; accent-color: var(--fit-ink); cursor: pointer; }
.fit-measure { margin:0 0 .65rem; font-size:.875rem; }
.fit-measure summary { width:fit-content; padding:.35rem 0; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.fit-measure p { margin:.25rem 0 .5rem; color:var(--fit-muted); line-height:1.5; }
.fit-width-row { display:flex; gap:.45rem; margin-top:.25rem; }
.fit-width-row input { width:6rem; min-width:0; min-height:44px; padding:0 .6rem; border:1px solid var(--fit-line); border-radius:7px; font-size:16px; color:var(--fit-ink); background:#fff; }
.fit-width-row button { min-height:44px; padding:0 .85rem; color:var(--fit-ink); border:1px solid var(--fit-line); border-radius:2rem; background:white; }
.fit-width-row button:disabled { cursor:default; }
.fit-measure p:empty { display:none; }
@media (max-width: 620px) {
  .fit-dialog { width: calc(100% - 20px); max-height: 92vh; max-height: 92dvh; border-radius: 18px; }
  .fit-shell { padding: 20px; }
  .fit-head { margin-bottom: 17px; }
  .fit-body { grid-template-columns: 1fr; gap: 17px; }
  .fit-stage { aspect-ratio: 1.45; max-height: 38vh; max-height: 38dvh; }
  .fit-stage:has(.fit-preview:not([hidden])) { aspect-ratio: 1.16; max-height: 43dvh; }
  .fit-intro p { margin: 3px 0 13px; }
  .fit-intro br { display: none; }
  .fit-side .fit-filetype { margin-top: 8px; }
  .fit-rule { margin: 13px 0; }
  .fit-range { margin-bottom: 2px; }
  .fit-side .fit-note { margin: 7px 0 14px; }
}
.fit-sample { display: inline-flex; align-items: center; min-height: 40px; margin: 11px 0 0; padding: 0; border: 0; background: none; color: var(--fit-ink); text-decoration: underline; text-underline-offset: 4px; font-size: .91rem !important; }
.fit-sample:hover { color: #825537; }
.fit-look { display: grid; gap: 5px; margin-top: 15px; }
.fit-style-label, .fit-colors legend { font-size: .9375rem; font-weight: 500; }
.fit-select { width: 100%; min-height: 38px; border: 1px solid var(--fit-line); border-radius: 8px; padding: 5px 34px 5px 10px; appearance: none; -webkit-appearance: none; color: var(--fit-ink); font: inherit; font-size: .94rem; cursor: pointer; background: linear-gradient(45deg, transparent 50%, #605c55 51%) calc(100% - 17px) 53%/5px 5px no-repeat, linear-gradient(135deg, #605c55 49%, transparent 51%) calc(100% - 12px) 53%/5px 5px no-repeat, white; }
.fit-colors { min-width: 0; margin: 6px 0 0; padding: 0; border: 0; }
.fit-colors legend { padding: 0; }
.fit-color-name { color: var(--fit-muted); margin-left: 5px; font-size: .84rem; }
.fit-swatches { display: flex; flex-wrap: wrap; gap: 2px 3px; padding: 4px 0 0; }
.fit-swatch { position: relative; width: 32px; height: 32px; border: 1.5px solid transparent; border-radius: 50%; background: transparent; }
.fit-swatch::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--fit-swatch); border: 1px solid rgba(47,38,33,.15); }
.fit-swatch[aria-pressed="true"] { border-color: var(--fit-ink); }
.fit-controls .fit-rule { margin: 15px 0; }
@media (min-width:621px) { .fit-dialog:has(.fit-controls:not([hidden])) .fit-stage { align-self: center; } }
@media (max-width:620px) {
  .fit-look { margin-top: 12px; }
  .fit-side .fit-sample { margin-top: 1px; }
  .fit-controls .fit-rule { margin: 12px 0; }
}

.fit-stage-group { min-width: 0; align-self: center; }
.fit-pane { position: absolute; inset: 0; }
.fit-is-comparing .fit-pane-a { clip-path: inset(0 calc(100% - var(--fit-split)) 0 0); }
.fit-is-comparing .fit-pane-b { clip-path: inset(0 0 0 var(--fit-split)); }
.fit-divider-line { position: absolute; inset: 0 auto 0 var(--fit-split); width: 1.5px; background: white; box-shadow: 0 0 3px #211b1466; }
.fit-divider { position: absolute; top: 0; bottom: 0; left: clamp(var(--fit-min-handle,0px),calc(var(--fit-split) - 22px),var(--fit-max-handle,calc(100% - 44px))); width: 44px; touch-action: none; cursor: ew-resize; pointer-events: auto; }
.fit-divider span { position: absolute; top: var(--fit-grip-y,76%); left: 50%; transform: translate(-50%,-50%); width: 36px; height: 31px; display: grid; place-items: center; background: #fff; color: #211f1c; box-shadow: 0 1px 6px #30251d59; border-radius: 18px; }
.fit-divider svg { width: 21px; height: 15px; }
.fit-dialog .fit-divider:focus-visible { outline: none; }
.fit-divider:focus-visible span { outline: 3px solid #244985; outline-offset: 2px; }
.fit-key { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.fit-key > div { display: flex; gap: 7px; align-items: center; min-width: 0; font-size: .84rem; line-height: 1.4; color: #4e4b47; }
.fit-key > div:last-child { justify-content: end; }
.fit-key b { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; font: 600 .75rem/1 -apple-system,BlinkMacSystemFont,sans-serif; border-radius: 50%; border: 1px solid #bdb8af; }
.fit-key > div:last-child b { color: white; background: #25272a; border-color: #25272a; }
.fit-compare-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; margin-top: 9px; }
.fit-compare-tools button { display: inline-flex; min-height: 38px; align-items: center; color: #33312e; font-size: .88rem; }
.fit-compare-toggle { border: 1px solid #c8c4be; border-radius: 30px; background: #fff; padding: 5px 13px; }
.fit-compare-toggle::before { content: ''; width: 13px; height: 12px; margin-right: 7px; border: 1px solid currentColor; border-radius: 3px; background: linear-gradient(90deg,#494743 48%,transparent 48%); }
.fit-compare-toggle[aria-pressed="true"] { background: #edeae4; }
.fit-swap { background: none; border: 0; padding: 3px; text-decoration: underline; text-underline-offset: 3px; }
.fit-dialog .fit-swap:disabled { cursor: default; }
.fit-samples, .fit-placement-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 16px; }
.fit-placement { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; margin-top: 7px; }
.fit-placement .fit-placement-note { font-size: .84rem; line-height: 1.4; color: #53504a; }
.fit-placement-actions button { border: 0; background: none; padding: 2px 1px; font-size: .84rem; min-height: 32px; color: #30332e; text-decoration: underline; text-underline-offset: 3px; }

.fit-arm-controls { margin: 0 0 1.2rem; padding: 0; border: 0; min-width: 0; }
.fit-arm-controls legend { font-weight: 600; padding: 0; }
.fit-arm-options { display: flex; gap: .4rem; margin: .35rem 0 .75rem; }
.fit-arm-options button { padding: .4rem .9rem; min-height: 44px; border: 1px solid var(--fit-line); border-radius: 2rem; background: white; }
.fit-arm-options [aria-pressed="true"] { background: var(--fit-ink); color: white; }
.fit-tone-ends { display: flex; justify-content: space-between; color: var(--fit-muted); font-size: .85rem; }
#fit-tone { display: block; margin: 0; }
.fit-dialog .fit-stage.with-arm { aspect-ratio: 2; }
.fit-dialog .fit-stage.with-arm.is-closeup { aspect-ratio: 1.55; }

.fit-picker { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr); gap:6px 12px; margin:0 0 14px; }
.fit-picker[hidden], .fit-look[hidden], .fit-variants:empty { display:none; }
.fit-picker label { display:grid; gap:3px; font-weight:600; min-width:0; font-size:.88rem; }
.fit-picker select { min-width:0; min-height:42px; text-overflow:ellipsis; }
.fit-frame-examples { justify-self:start; text-align:start; }
.fit-frame-examples, .fit-shop-total, .fit-variants { grid-column:1 / -1; }
.fit-shop-total { display:flex; flex-wrap:wrap; align-items:baseline; gap:.25rem .9rem; margin:0; font-size:.86rem; }
.fit-body-inquiry a { text-decoration:underline; text-underline-offset:.18em; }
.fit-variants { display:flex; gap:6px; overflow-x:auto; padding:3px; }
.fit-variants button { flex:0 0 44px; width:44px; height:44px; padding:2px; background:white; border:1px solid #bab5ad; border-radius:6px; }
.fit-variants button[aria-pressed=true] { outline:2px solid #243948; }
.fit-variants img { width:100%; height:100%; object-fit:cover; border-radius:3px; }
@media(max-width:620px) {
  .fit-picker { grid-template-columns:minmax(0,1fr); gap:6px 8px; }
  .fit-picker select { font-size:16px; }
}

.fit-photo-actions { display:flex; align-items:center; flex-wrap:wrap; gap:.45rem; }
.fit-photo-actions .fit-camera { min-height:45px; border:1px solid var(--fit-line); border-radius:30px; padding:.55rem 1rem; font-weight:550; }
.fit-photo-actions [hidden] { display:none; }

.fit-band-wrap { z-index:-1; mask:var(--fit-watch-mask,none) center/100% 100%; -webkit-mask:var(--fit-watch-mask,none) center/100% 100%; }
.fit-watch, .fit-watch-position > [data-watch-backup] { clip-path:inset(var(--fit-live-top,0%) 0 var(--fit-live-bottom,0%)); }

.fit-skin-contact { z-index:-2; }

.fit-watch-position[data-preparing] { visibility:hidden; }
.fit-loading {
  position:absolute; inset:auto auto .65rem; margin:0; padding:.27rem .75rem; border-radius:1.5rem;
  background:rgba(250,249,246,.94); color:var(--fit-ink); font-size:.81rem; pointer-events:none;
}
.fit-render-notice { margin-top:.5rem; color:var(--fit-muted); font-size:.875rem; }
