:root {
  --ap-bg: #e8e9ea;
  --ap-panel: #f6f7f7;
  --ap-panel-2: #eceeea;
  --ap-line: #d1d3d5;
  --ap-line-strong: #bfc3c5;
  --ap-text: #111214;
  --ap-muted: #6f7478;
  --ap-accent: #4b5054;
  --ap-accent-dark: #202326;
  --ap-danger: #34383b;
}

.aerie-photo-launcher {
  position: fixed;
  top: max(88px, calc(env(safe-area-inset-top) + 70px));
  right: 18px;
  z-index: 1500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(12, 15, 17, 0.97), rgba(31, 35, 38, 0.96));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.34);
  color: #fff;
  font: 700 11px/1 Montserrat, Arial, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.capture-actions .aerie-photo-launcher {
  position: static;
  z-index: auto;
  min-height: 43px;
  padding: 0 16px;
  color: var(--ap-text);
  border: 1px solid rgba(17, 19, 21, 0.18);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(12px);
}

.capture-actions .aerie-photo-launcher svg { stroke: var(--ap-text); }

.capture-actions .aerie-photo-launcher:hover,
.capture-actions .aerie-photo-launcher:focus-visible {
  color: #fff;
  border-color: var(--ap-accent-dark);
  background: var(--ap-accent-dark);
}

.capture-actions .aerie-photo-launcher:hover svg,
.capture-actions .aerie-photo-launcher:focus-visible svg { stroke: #fff; }

.aerie-photo-launcher:hover,
.aerie-photo-launcher:focus-visible {
  transform: translateY(-2px);
  border-color: #fff;
  background: #17191b;
  outline: none;
}

.aerie-photo-launcher svg { width: 18px; height: 18px; stroke: #fff; }

.aerie-photo-studio[hidden] { display: none !important; }

.aerie-photo-studio {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  color: var(--ap-text);
  background: var(--ap-bg);
  font-family: Montserrat, Arial, sans-serif;
  isolation: isolate;
}

.aerie-photo-app {
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.aerie-photo-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  border-bottom: 1px solid #3a3d40;
  background: rgba(20, 22, 24, 0.99);
  color: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
}

.aerie-photo-wordmark { display: flex; align-items: baseline; gap: 10px; }
.aerie-photo-wordmark a { display: inline-flex; color: inherit; text-decoration: none; }
.aerie-photo-wordmark a:hover strong { color: #d9dcde; }
.aerie-photo-wordmark a:focus-visible { border-radius: 3px; outline: 1px solid #fff; outline-offset: 5px; }
.aerie-photo-wordmark strong { font-size: 16px; font-style: italic; font-weight: 900; letter-spacing: -0.02em; }
.aerie-photo-wordmark span { color: #b9bec1; font-size: 8px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.aerie-photo-top-actions { display: flex; align-items: center; gap: 8px; }

.aerie-photo-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 338px;
  min-height: 0;
}

.aerie-photo-rail,
.aerie-photo-inspector {
  min-height: 0;
  overflow-y: auto;
  background: var(--ap-panel);
  color: var(--ap-text);
}

.aerie-photo-rail { border-right: 1px solid var(--ap-line); padding: 18px 14px; }
.aerie-photo-inspector { border-left: 1px solid var(--ap-line); padding: 16px; }
.aerie-photo-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #d9dcde; }

.aerie-photo-steps { display: grid; gap: 6px; }
.aerie-photo-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #73787a;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}
.aerie-photo-step i {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--ap-line-strong);
  border-radius: 50%;
  color: inherit;
  font: normal 700 10px/1 Montserrat, sans-serif;
}
.aerie-photo-step strong { display: block; color: inherit; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.aerie-photo-step small { display: block; margin-top: 3px; color: #8a8e90; font-size: 9px; line-height: 1.35; }
.aerie-photo-step.is-active { border-color: var(--ap-text); background: var(--ap-text); color: #fff; }
.aerie-photo-step.is-active small { color: #b9bec0; }
.aerie-photo-step.is-active i { border-color: #fff; color: #fff; }
.aerie-photo-step.is-complete { color: var(--ap-text); }
.aerie-photo-step.is-complete i { border-color: var(--ap-accent); background: var(--ap-accent); color: #fff; }

.aerie-photo-rail-note {
  margin: 22px 4px 0;
  padding-top: 16px;
  border-top: 1px solid var(--ap-line);
  color: #7d8284;
  font-size: 9px;
  line-height: 1.55;
}

.aerie-photo-view { position: absolute; inset: 0; display: grid; place-items: center; padding: 26px; overflow: auto; }
.aerie-photo-view[hidden] { display: none !important; }

.aerie-photo-upload-card {
  width: min(720px, 100%);
  padding: 42px;
  border: 1px solid var(--ap-line);
  border-radius: 12px;
  background: var(--ap-panel);
  box-shadow: 0 30px 80px rgba(17, 18, 20, 0.18);
  text-align: center;
}
.aerie-photo-upload-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 18px; border: 1px solid var(--ap-line); border-radius: 50%; background: #fff; }
.aerie-photo-upload-icon svg { width: 25px; height: 25px; stroke: var(--ap-accent-dark); }
.aerie-photo-kicker { color: var(--ap-accent); font-size: 9px; font-style: italic; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; }
.aerie-photo-upload-card h1 { margin: 10px 0 12px; color: var(--ap-text); font-size: clamp(26px, 4vw, 48px); font-style: italic; font-weight: 900; line-height: .98; letter-spacing: -.045em; text-transform: uppercase; }
.aerie-photo-upload-card > p { max-width: 560px; margin: 0 auto; color: var(--ap-muted); font-size: 12px; line-height: 1.65; }

.aerie-photo-dropzone {
  display: grid;
  place-items: center;
  min-height: 160px;
  margin-top: 26px;
  padding: 22px;
  border: 1px dashed #b8bcbd;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}
.aerie-photo-dropzone:hover,
.aerie-photo-dropzone.is-over { border-color: var(--ap-accent-dark); background: #f0f1f1; }
.aerie-photo-dropzone strong { font-size: 12px; letter-spacing: .05em; }
.aerie-photo-dropzone span { margin-top: 6px; color: #7d8284; font-size: 10px; }
.aerie-photo-file-meta { margin-top: 12px; color: #62676a; font-size: 10px; }
.aerie-photo-privacy { max-width: 610px; margin: 12px auto 0; color: #6f7478; font-size: 8px; line-height: 1.5; }

.aerie-photo-view[data-photo-view="processing"] { background: #17191b; color: #fff; }
.aerie-photo-processing-card { width: min(600px, 100%); text-align: center; }
.aerie-photo-scan {
  position: relative;
  width: 156px;
  height: 156px;
  margin: 0 auto 24px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  overflow: hidden;
  background: #141719;
  box-shadow: inset 0 0 34px rgba(255,255,255,.025), 0 0 34px rgba(0,0,0,.16);
}
.aerie-photo-scan::before { content: ""; position: absolute; z-index: 7; inset: 20px; border: 1px solid rgba(255,255,255,.48); border-radius: 50%; pointer-events: none; }
.aerie-photo-scan::after { content: ""; position: absolute; z-index: 8; left: 10%; right: 10%; top: 12%; height: 2px; background: #fff; box-shadow: 0 0 18px rgba(255,255,255,.58); animation: aeriePhotoScan 1.7s ease-in-out infinite alternate; pointer-events: none; }
@keyframes aeriePhotoScan { to { top: 86%; } }
.aerie-photo-processing-card h2 { margin: 0 0 9px; font-size: 28px; font-style: italic; font-weight: 900; letter-spacing: -1px; text-transform: uppercase; }
.aerie-photo-processing-card p { min-height: 38px; color: #b8bec1; font-size: 11px; line-height: 1.5; }
.aerie-photo-late-status { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 24px; margin: 2px auto 0; color: #eef0f1; }
.aerie-photo-late-status[hidden] { display: none; }
.aerie-photo-late-status > i { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.62); animation: aeriePhotoStatusPulse 1.2s ease-in-out infinite alternate; }
.aerie-photo-late-status strong { font-size: 9px; font-weight: 600; letter-spacing: .045em; }
.aerie-photo-late-status strong.is-moving { animation: aeriePhotoStatusMove 4.2s ease both; }
@keyframes aeriePhotoStatusPulse { to { opacity: .35; transform: scale(.72); } }
@keyframes aeriePhotoStatusMove {
  0% { opacity: 0; transform: translate3d(-12px, 5px, 0); }
  14%, 84% { opacity: 1; transform: translate3d(0, 0, 0); }
  100% { opacity: 0; transform: translate3d(12px, -5px, 0); }
}
.aerie-photo-progress { width: 100%; height: 4px; margin-top: 20px; overflow: hidden; background: #20262b; }
.aerie-photo-progress i { display: block; width: 8%; height: 100%; background: #fff; box-shadow: 0 0 14px rgba(255,255,255,.38); transition: width 420ms ease; }
.aerie-photo-progress-meta { display: flex; justify-content: space-between; margin-top: 8px; color: #92979a; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }

.aerie-photo-editor-view { display: grid; grid-template-rows: minmax(0, 1fr) auto; place-items: stretch; padding: 0; }
.aerie-photo-canvas-wrap { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; padding: 22px; background-image: linear-gradient(45deg, #d9dcde 25%, transparent 25%), linear-gradient(-45deg, #d9dcde 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d9dcde 75%), linear-gradient(-45deg, transparent 75%, #d9dcde 75%); background-color: #e8e9ea; background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0px; }
.aerie-photo-canvas-shell { position: relative; max-width: 100%; max-height: 100%; box-shadow: 0 20px 70px rgba(0,0,0,.55); line-height: 0; }
.aerie-photo-canvas { display: block; max-width: 100%; max-height: calc(100vh - 162px); width: auto; height: auto; cursor: crosshair; touch-action: none; }
.aerie-photo-canvas-help { position: absolute; left: 32px; bottom: 22px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.22); border-radius: 7px; background: rgba(17,18,20,.9); color: #c8ccce; font-size: 9px; line-height: 1.4; backdrop-filter: blur(8px); }
.aerie-photo-canvas-help strong { color: #fff; }

.aerie-photo-editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; min-height: 58px; padding: 9px 14px; border-top: 1px solid #3a3d40; background: #141618; }

.aerie-photo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--ap-line);
  border-radius: 7px;
  background: #fff;
  color: var(--ap-text);
  font: 700 9px/1 Montserrat, Arial, sans-serif;
  letter-spacing: .09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 170ms ease, border-color 170ms ease, color 170ms ease, transform 170ms ease;
}
.aerie-photo-btn:hover:not(:disabled),
.aerie-photo-btn:focus-visible:not(:disabled) { border-color: var(--ap-accent-dark); color: var(--ap-accent-dark); background: #f0f1f1; outline: none; transform: translateY(-1px); }
.aerie-photo-btn:disabled { opacity: .38; cursor: not-allowed; }
.aerie-photo-btn.is-primary { border-color: var(--ap-accent-dark); background: var(--ap-accent-dark); color: #fff; }
.aerie-photo-btn.is-primary:hover:not(:disabled) { border-color: #3a3e42; background: #3a3e42; color: #fff; box-shadow: 0 8px 20px rgba(17,18,20,.2); }
.aerie-photo-btn.is-danger { color: #34383b; border-color: #aeb2b4; }
.aerie-photo-btn.is-active { border-color: var(--ap-text); color: #fff; background: var(--ap-text); }
.aerie-photo-btn svg { width: 15px; height: 15px; stroke-width: 2; }
.aerie-photo-close { width: 38px; padding: 0; }
.aerie-photo-close .aerie-photo-home-brush-icon { width: 20px; height: 20px; stroke-width: 1.7; }
.aerie-photo-topbar .aerie-photo-btn { color: #e8eae8; border-color: rgba(255,255,255,.16); border-radius: 999px; background: transparent; }
.aerie-photo-topbar .aerie-photo-btn:hover:not(:disabled),
.aerie-photo-topbar .aerie-photo-btn:focus-visible:not(:disabled) { color: #fff; border-color: #fff; background: transparent; }
.aerie-photo-editor-toolbar .aerie-photo-btn { color: #e8eae8; border-color: rgba(255,255,255,.16); background: transparent; }
.aerie-photo-editor-toolbar .aerie-photo-btn:hover:not(:disabled),
.aerie-photo-editor-toolbar .aerie-photo-btn:focus-visible:not(:disabled) { color: #fff; border-color: #fff; background: transparent; }
.aerie-photo-editor-toolbar .aerie-photo-btn.is-primary { color: #111214; border-color: #fff; background: #fff; }

.aerie-photo-inspector-empty { display: grid; place-items: center; min-height: 240px; padding: 28px; color: #7d8284; font-size: 10px; line-height: 1.6; text-align: center; }
.aerie-photo-inspector-content[hidden], .aerie-photo-result[hidden] { display: none !important; }
.aerie-photo-section { padding: 0 0 16px; margin: 0 0 16px; border-bottom: 1px solid var(--ap-line); }
.aerie-photo-section:last-child { border-bottom: 0; }
.aerie-photo-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.aerie-photo-section h3 { margin: 0; color: var(--ap-text); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.aerie-photo-section p { margin: 7px 0 0; color: #73787a; font-size: 9px; line-height: 1.5; }
.aerie-photo-confidence { color: var(--ap-accent-dark); font-size: 9px; font-weight: 800; }
.aerie-photo-zone-select,
.aerie-photo-panel-select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--ap-line-strong);
  border-radius: 7px;
  outline: none;
  background: #fff;
  color: var(--ap-text);
  font: 600 10px Montserrat, sans-serif;
}
.aerie-photo-zone-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.aerie-photo-zone-meta span { padding: 8px; border: 1px solid var(--ap-line); border-radius: 6px; background: #eceeea; color: #7d8284; font-size: 8px; text-transform: uppercase; }
.aerie-photo-zone-meta strong { display: block; margin-top: 4px; color: var(--ap-text); font-size: 9px; }

.aerie-photo-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; max-height: 156px; overflow-y: auto; padding: 2px; }
.aerie-photo-swatch { position: relative; aspect-ratio: 1; border: 1px solid #cfd2d3; border-radius: 5px; background: var(--swatch); cursor: pointer; }
.aerie-photo-swatch::after { content: ""; position: absolute; inset: -3px; border: 1px solid transparent; border-radius: 7px; }
.aerie-photo-swatch:hover::after, .aerie-photo-swatch.is-active::after { border-color: var(--ap-accent-dark); }
.aerie-photo-swatch.is-active::before { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 800 12px Montserrat, sans-serif; text-shadow: 0 1px 3px #000; }
.aerie-photo-finish-name { margin-top: 9px; color: var(--ap-text); font-size: 9px; font-weight: 800; }

.aerie-photo-segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.aerie-photo-segmented button { min-height: 34px; }
.aerie-photo-range { width: 100%; accent-color: var(--ap-accent-dark); }
.aerie-photo-range-row { display: grid; grid-template-columns: 1fr 46px; gap: 10px; align-items: center; }
.aerie-photo-range-value { color: var(--ap-text); font-size: 9px; font-weight: 800; text-align: right; }

.aerie-photo-notice { margin-bottom: 13px; padding: 10px; border-left: 2px solid var(--ap-accent-dark); background: #eceeea; color: #62676a; font-size: 9px; line-height: 1.5; }
.aerie-photo-notice.is-warning { border-color: #666c70; background: #e4e6e6; }
.aerie-photo-error { margin-top: 12px; padding: 9px 10px; color: #202326; border-left: 2px solid #4b5054; background: #e4e6e6; font-size: 10px; line-height: 1.5; }

.aerie-photo-result-view { padding: 18px; }
.aerie-photo-result-card { display: grid; grid-template-rows: auto minmax(0,1fr) auto; width: min(1180px, 100%); height: min(820px, 100%); color: #fff; border: 1px solid #3a3d40; background: #111315; box-shadow: 0 30px 100px rgba(0,0,0,.45); }
.aerie-photo-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid #3a3d40; }
.aerie-photo-result-head h2 { margin: 0; font-size: 17px; font-style: italic; font-weight: 900; letter-spacing: -.02em; text-transform: uppercase; }
.aerie-photo-result-head .aerie-photo-kicker { color: #b9bec1; }
.aerie-photo-result-image-wrap { min-height: 0; display: grid; place-items: center; overflow: hidden; background: #080a0c; }
.aerie-photo-result-image { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.aerie-photo-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 12px; border-top: 1px solid #3a3d40; }
.aerie-photo-disclaimer { padding: 0 16px 13px; color: #92979a; font-size: 8px; line-height: 1.45; text-align: center; }

.aerie-photo-spinner { width: 14px; height: 14px; border: 2px solid rgba(0,0,0,.25); border-top-color: currentColor; border-radius: 50%; animation: aeriePhotoSpin .7s linear infinite; }
@keyframes aeriePhotoSpin { to { transform: rotate(360deg); } }

@media (max-width: 1080px) {
  .aerie-photo-grid { grid-template-columns: 190px minmax(0, 1fr) 300px; }
  .aerie-photo-upload-card { padding: 32px; }
}

@media (max-width: 820px) {
  .capture-actions .aerie-photo-launcher { position: absolute; top: auto; bottom: 112px; right: 64px; width: auto; min-height: 44px; padding: 0 13px; font-size: 6.5px; }
  .aerie-photo-app { grid-template-rows: calc(58px + env(safe-area-inset-top)) minmax(0, 1fr); }
  .aerie-photo-topbar { padding-top: env(safe-area-inset-top); }
  .aerie-photo-wordmark span { font-size: 6px; letter-spacing: .11em; }
  .aerie-photo-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .aerie-photo-rail { display: none; }
  .aerie-photo-inspector { position: absolute; z-index: 8; left: 0; right: 0; bottom: 0; max-height: 46vh; border: 0; border-top: 1px solid var(--ap-line-strong); box-shadow: 0 -18px 50px rgba(0,0,0,.5); }
  .aerie-photo-studio:not(.is-editor) .aerie-photo-inspector { display: none; }
  .aerie-photo-stage { grid-column: 1; grid-row: 1; }
  .aerie-photo-view { padding: 14px; }
  .aerie-photo-upload-card { padding: 25px 18px; }
  .aerie-photo-upload-card h1 { font-size: 30px; }
  .aerie-photo-scan { width: 142px; height: 142px; }
  .aerie-photo-editor-view { padding: 0; padding-bottom: 46vh; }
  .aerie-photo-canvas-wrap { padding: 10px; }
  .aerie-photo-canvas { max-height: calc(54vh - 70px); }
  .aerie-photo-canvas-help { left: 12px; bottom: 12px; max-width: 70%; }
  .aerie-photo-editor-toolbar { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .aerie-photo-editor-toolbar .aerie-photo-btn { flex: 0 0 auto; }
}

@media (max-width: 520px) {
  .aerie-photo-wordmark span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .aerie-photo-launcher,
  .aerie-photo-step,
  .aerie-photo-btn,
  .aerie-photo-progress i { transition: none; }
  .aerie-photo-scan::after,
  .aerie-photo-spinner,
  .aerie-photo-late-status > i,
  .aerie-photo-late-status strong.is-moving { animation: none; }
}
