﻿:root {
  color-scheme: light;
  --ink: #2d2320;
  --muted: #766a66;
  --line: rgba(64, 45, 39, 0.13);
  --paper: #fffaf6;
  --pearl: #fbf3ee;
  --blush: #f4ddd6;
  --coral: #c96f5b;
  --coral-dark: #a65344;
  --gold: #b8955d;
  --mint: #dcefe8;
  --shadow: 0 24px 70px rgba(73, 43, 34, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(220, 239, 232, 0.9), transparent 32rem),
    linear-gradient(135deg, #fffaf6 0%, #f8efe8 52%, #fffdf9 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px 24px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 780;
}

h2 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 0.96;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 20px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.workspace {
  border: 1px solid var(--line);
  background: rgba(255, 250, 246, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.workspace {
  padding: 22px;
  border-radius: 8px;
}

.hero-copy p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.photo-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #2d2320, #6d5148);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 28px;
  text-align: center;
  color: #fff9f4;
  background:
    linear-gradient(rgba(45, 35, 32, 0.34), rgba(45, 35, 32, 0.5)),
    radial-gradient(circle at 48% 20%, rgba(255, 255, 255, 0.2), transparent 18rem);
}

.empty-state.is-hidden {
  display: none;
}

.empty-state h3 {
  margin: 16px 0 8px;
  font-size: 30px;
}

.empty-state p {
  max-width: 320px;
  color: rgba(255, 250, 246, 0.8);
}

.spark {
  width: 86px;
  height: 86px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 47%, rgba(255, 255, 255, 0.9) 48% 52%, transparent 53%),
    linear-gradient(0deg, transparent 47%, rgba(255, 255, 255, 0.9) 48% 52%, transparent 53%);
}

.stage-actions,
.brief-actions,
.empty-actions,
.camera-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 760;
  text-decoration: none;
}

.primary-button {
  background: var(--coral);
  color: white;
  box-shadow: 0 12px 24px rgba(201, 111, 91, 0.28);
}

.secondary-button,
.ghost-button {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.empty-actions {
  justify-content: center;
}

.file-button input {
  display: none;
}

.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(45, 35, 32, 0.52);
  backdrop-filter: blur(14px);
}

.camera-modal.is-open {
  display: flex;
}

.camera-card {
  position: relative;
  overflow: hidden;
  width: min(760px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 16px;
}

.camera-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.camera-card video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: #2d2320;
  object-fit: cover;
  transform: none;
}

.camera-guide {
  pointer-events: none;
  position: absolute;
  inset: 92px 16px 92px;
  display: grid;
  place-items: center;
}

.camera-guide span:first-child {
  width: min(58%, 360px);
  aspect-ratio: 1 / 1.28;
  border: 1px solid rgba(255, 250, 246, 0.74);
  border-radius: 50%;
}

.camera-guide span:last-child {
  position: absolute;
  width: min(38%, 260px);
  height: 13%;
  border: 1px solid rgba(255, 250, 246, 0.72);
  border-radius: 999px;
  transform: translateY(70%);
}

.medical-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.stage-guide {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  opacity: 0.92;
}

.stage-guide span {
  position: absolute;
}

.guide-face {
  width: min(48%, 360px);
  aspect-ratio: 1 / 1.32;
  border: 1px solid rgba(255, 250, 246, 0.54);
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.03);
}

.guide-center {
  width: 1px;
  height: 68%;
  background: linear-gradient(transparent, rgba(255, 250, 246, 0.78), transparent);
}

.guide-mouth {
  top: 61%;
  width: min(34%, 260px);
  height: 8.5%;
  border: 1px solid rgba(255, 250, 246, 0.82);
  border-radius: 999px;
  background: rgba(45, 35, 32, 0.1);
}

.guide-label {
  top: calc(61% + 9%);
  border-radius: 999px;
  background: rgba(45, 35, 32, 0.56);
  color: #fffaf6;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 760;
}

.has-photo .stage-guide {
  opacity: 0.42;
}

.has-photo .guide-label {
  display: none;
}
@media (max-width: 640px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
  }

  .workspace {
    padding: 14px;
  }
}


/* Camera-first mobile layout */
@media (max-width: 760px) {
  body {
    overflow: hidden;
    background: #15100f;
  }

  .app-shell {
    height: 100dvh;
    padding: 0;
    display: grid;
    grid-template-rows: auto 1fr;
  }

  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 8;
    padding: 10px 12px;
    color: #fffaf6;
    background: linear-gradient(rgba(21, 16, 15, 0.72), rgba(21, 16, 15, 0));
  }

  .topbar .eyebrow {
    display: none;
  }

  h1 {
    font-size: 22px;
  }

  .topbar .ghost-button {
    min-height: 36px;
    background: rgba(255, 250, 246, 0.16);
    color: #fffaf6;
    border-color: rgba(255, 255, 255, 0.22);
  }

  .layout {
    height: 100dvh;
    display: block;
  }

  .workspace {
    height: 100dvh;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #15100f;
    box-shadow: none;
  }
  .hero-copy,
  .medical-note {
    display: none;
  }

  .photo-stage {
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    aspect-ratio: auto;
  }

  .stage-actions {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(45dvh + 10px);
    z-index: 7;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 6px;
    border-radius: 999px;
    background: rgba(21, 16, 15, 0.42);
    backdrop-filter: blur(16px);
  }

  .stage-actions .secondary-button,
  .stage-actions .primary-button {
    min-height: 38px;
    flex: 0 0 auto;
    padding: 0 13px;
    font-size: 13px;
  }
}


.guide-focus {
  top: 31%;
  width: min(44%, 320px);
  height: 45%;
  border: 1px solid rgba(255, 250, 246, 0.48);
  border-radius: 34% 34% 46% 46%;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
}

.guide-nose,
.guide-chin {
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(35, 24, 22, 0.48);
  color: rgba(255, 250, 246, 0.92);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 780;
}

.guide-nose {
  top: 42%;
}

.guide-chin {
  top: 72%;
}

.has-photo .guide-nose,
.has-photo .guide-chin {
  display: none;
}


/* SmileDraft mobile refinement v9 */
.guide-face,
.guide-focus,
.guide-mouth {
  box-shadow: 0 0 0 1px rgba(35, 24, 22, 0.16), 0 0 18px rgba(255, 250, 246, 0.26);
}

.guide-mouth::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72%;
  height: 1px;
  transform: translate(-50%, -50%);
  background: rgba(255, 250, 246, 0.9);
}


@media (max-width: 760px) {

  .bottom-toolbar {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .guide-focus {
    top: 28%;
    width: min(60%, 320px);
    height: 47%;
  }

  .guide-nose {
    top: 40%;
  }

  .guide-mouth {
    top: 55%;
    width: min(52%, 290px);
    height: 8%;
  }

  .guide-chin {
    top: 70%;
  }
}

/* Professional capture-first UI v10 */
.photo-stage:not(.has-photo) #centerGuide,
.photo-stage:not(.has-photo) #flipPhoto,
.photo-stage:not(.has-photo) #toggleBefore,
.photo-stage:not(.has-photo) #downloadImage {
  display: none;
}

.photo-stage:not(.has-photo) .bottom-toolbar {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  left: 18px;
  right: 18px;
  bottom: max(22px, env(safe-area-inset-bottom));
  padding: 10px;
  border-radius: 28px;
  background: rgba(27, 20, 19, 0.38);
}

.photo-stage:not(.has-photo) .bottom-toolbar .tool-button {
  min-height: 54px;
  font-size: 14px;
  background: rgba(255, 250, 246, 0.9);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.5);
}

.photo-stage:not(.has-photo) .bottom-toolbar .tool-button:nth-child(n+4) {
  display: none;
}

.photo-stage:not(.has-photo) .empty-state {
  background:
    linear-gradient(rgba(28, 20, 19, 0.24), rgba(28, 20, 19, 0.4)),
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.1), transparent 18rem);
}

.photo-stage:not(.has-photo) .empty-state h3 {
  position: absolute;
  top: 19%;
  left: 0;
  right: 0;
  margin: 0 auto;
  font-size: 26px;
  line-height: 1.05;
}

.photo-stage:not(.has-photo) .empty-state p {
  position: absolute;
  top: calc(19% + 34px);
  left: 14%;
  right: 14%;
  max-width: none;
  font-size: 15px;
  line-height: 1.35;
}

.photo-stage:not(.has-photo) .empty-actions {
  display: none;
}

.photo-stage:not(.has-photo) .spark {
  display: none;
}

.stage-guide {
  opacity: 1;
}

.guide-face {
  width: min(56%, 360px);
  aspect-ratio: 1 / 1.42;
  border: 1.5px solid rgba(255, 250, 246, 0.72);
  border-radius: 46% 46% 50% 50%;
  box-shadow: 0 0 0 1px rgba(35, 24, 22, 0.18), 0 0 24px rgba(255, 250, 246, 0.12);
}

.guide-focus {
  top: 33%;
  width: min(42%, 270px);
  height: 37%;
  border: 1px dashed rgba(255, 250, 246, 0.58);
  border-radius: 40% 40% 48% 48%;
}

.guide-center {
  height: 58%;
  background: linear-gradient(transparent, rgba(255, 250, 246, 0.72), transparent);
}

.guide-nose,
.guide-chin,
.guide-label {
  background: rgba(27, 20, 19, 0.42);
  color: rgba(255, 250, 246, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
}

.guide-mouth {
  top: 58%;
  width: min(42%, 260px);
  height: 7.2%;
  border: 1.5px solid rgba(255, 250, 246, 0.88);
  background: rgba(27, 20, 19, 0.08);
}

.guide-label {
  top: calc(58% + 9%);
  max-width: 76%;
  text-align: center;
  white-space: normal;
}

.has-photo .stage-guide {
  opacity: 0.22;
}

@media (max-width: 760px) {
  .topbar {
    padding: 14px 16px;
  }

  .photo-stage:not(.has-photo) .guide-face {
    width: min(68%, 350px);
  }

  .photo-stage:not(.has-photo) .guide-focus {
    top: 31%;
    width: min(55%, 290px);
    height: 42%;
  }

  .photo-stage:not(.has-photo) .guide-mouth {
    top: 57%;
    width: min(54%, 280px);
    height: 7.5%;
  }

  .photo-stage:not(.has-photo) .guide-nose {
    top: 43%;
  }

  .photo-stage:not(.has-photo) .guide-chin {
    top: 72%;
  }
}

/* SmileDraft professional capture UI v11 */
:root {
  --clinical-teal: #6ab7ae;
  --clinical-teal-dark: #23766f;
  --warm-rose: #d9826f;
  --soft-glass: rgba(255, 255, 255, 0.72);
}

.topbar {
  letter-spacing: 0;
}

.line-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.line-icon::before,
.line-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.icon-camera::before {
  left: 2px;
  top: 6px;
  width: 18px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.icon-camera::after {
  left: 8px;
  top: 10px;
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon-live::before {
  left: 2px;
  top: 5px;
  width: 18px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.icon-live::after {
  right: 1px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.icon-upload::before {
  left: 4px;
  bottom: 3px;
  width: 14px;
  height: 8px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.icon-upload::after {
  left: 7px;
  top: 3px;
  width: 8px;
  height: 11px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.icon-align::before {
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon-align::after {
  left: 10px;
  top: 1px;
  width: 2px;
  height: 20px;
  background: currentColor;
  box-shadow: -8px 10px 0 -0.5px currentColor, 8px 10px 0 -0.5px currentColor;
}

.icon-flip::before {
  left: 3px;
  top: 5px;
  width: 16px;
  height: 12px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.icon-flip::after {
  left: 5px;
  top: 3px;
  width: 12px;
  height: 16px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: skewX(-18deg);
}

.icon-before::before {
  left: 3px;
  top: 5px;
  width: 16px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.icon-before::after {
  left: 11px;
  top: 5px;
  width: 2px;
  height: 12px;
  background: currentColor;
}

.icon-save::before {
  left: 4px;
  top: 3px;
  width: 14px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.icon-save::after {
  left: 8px;
  top: 12px;
  width: 6px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -5px 0 currentColor;
}

.tool-label {
  display: block;
  font-size: 10px;
  line-height: 1;
}

.tool-button {
  gap: 3px;
  flex-direction: column;
}

.camera-guide {
  inset: 78px 16px 104px;
}

.camera-guide span {
  position: absolute;
  display: block;
}

.camera-guide .camera-guide-face {
  width: min(62%, 360px);
  aspect-ratio: 1 / 1.42;
  border: 1.5px solid rgba(255, 255, 255, 0.78);
  border-radius: 46% 46% 50% 50%;
}

.camera-guide .camera-guide-center {
  width: 1px;
  height: 68%;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.78), transparent);
}

.camera-guide .camera-guide-nose {
  top: 40%;
  width: 42px;
  height: 22px;
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  border-top: 0;
  border-radius: 0 0 22px 22px;
}

.camera-guide .camera-guide-mouth {
  top: 57%;
  width: min(48%, 280px);
  height: 7.2%;
  border: 1.5px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
}

.camera-guide .camera-guide-chin {
  top: 72%;
  width: min(36%, 190px);
  height: 1px;
  background: rgba(255, 255, 255, 0.74);
}

@media (max-width: 760px) {
  body {
    background: #f8fbfa;
  }

  .topbar {
    align-items: center;
    padding: calc(10px + env(safe-area-inset-top)) 18px 42px;
    background: linear-gradient(rgba(18, 30, 29, 0.66), rgba(18, 30, 29, 0));
  }

  h1 {
    font-size: 24px;
    font-weight: 820;
  }

  .topbar .ghost-button {
    min-height: 34px;
    padding: 0 15px;
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.15);
    font-size: 13px;
  }

  .photo-stage {
    background:
      linear-gradient(180deg, rgba(16, 35, 34, 0.08), rgba(16, 35, 34, 0.18)),
      linear-gradient(145deg, #8ebeb7 0%, #d7e9e3 45%, #c98572 100%);
  }

  .photo-stage:not(.has-photo) .empty-state {
    background:
      linear-gradient(180deg, rgba(14, 25, 24, 0.18), rgba(14, 25, 24, 0.34)),
      radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.22), transparent 19rem);
  }

  .photo-stage:not(.has-photo) .empty-state h3 {
    top: 17.5%;
    font-size: 29px;
    font-weight: 820;
  }

  .photo-stage:not(.has-photo) .empty-state p {
    top: calc(17.5% + 42px);
    color: rgba(255, 255, 255, 0.86);
    font-size: 14px;
  }

  .photo-stage:not(.has-photo) .stage-guide {
    opacity: 0.96;
  }

  .photo-stage:not(.has-photo) .guide-face {
    width: min(70%, 352px);
    border-color: rgba(255, 255, 255, 0.76);
    box-shadow: 0 0 0 1px rgba(24, 58, 55, 0.12), 0 18px 80px rgba(20, 48, 45, 0.16);
  }

  .photo-stage:not(.has-photo) .guide-focus {
    top: 31.5%;
    width: min(54%, 286px);
    height: 42%;
    border-color: rgba(255, 255, 255, 0.44);
  }

  .photo-stage:not(.has-photo) .guide-center {
    height: 60%;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.72), transparent);
  }

  .photo-stage:not(.has-photo) .guide-nose,
  .photo-stage:not(.has-photo) .guide-chin {
    overflow: hidden;
    width: 42px;
    height: 28px;
    padding: 0;
    color: transparent;
    background: transparent;
    border: 0;
    backdrop-filter: none;
  }

  .photo-stage:not(.has-photo) .guide-nose::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 2px;
    width: 28px;
    height: 20px;
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    border-top: 0;
    border-radius: 0 0 20px 20px;
  }

  .photo-stage:not(.has-photo) .guide-chin::before {
    content: "";
    position: absolute;
    left: -42px;
    top: 13px;
    width: 126px;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.68);
  }

  .photo-stage:not(.has-photo) .guide-mouth {
    top: 57%;
    width: min(56%, 286px);
    height: 7.3%;
    border-color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.05);
  }

  .photo-stage:not(.has-photo) .guide-label {
    top: calc(57% + 9%);
    max-width: min(78%, 360px);
    padding: 7px 13px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(18, 32, 31, 0.42);
    font-size: 11px;
    letter-spacing: 0.02em;
  }

  .photo-stage:not(.has-photo) .bottom-toolbar {
    left: 22px;
    right: 22px;
    bottom: max(22px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.36);
    box-shadow: 0 18px 48px rgba(27, 54, 51, 0.2);
    backdrop-filter: blur(24px);
  }

  .photo-stage:not(.has-photo) .bottom-toolbar .tool-button {
    min-height: 60px;
    border-color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.86);
    color: #183a37;
    box-shadow: 0 10px 22px rgba(27, 54, 51, 0.12);
  }

  .photo-stage:not(.has-photo) .bottom-toolbar .tool-button:first-child {
    background: linear-gradient(180deg, #ffffff, #eaf7f4);
    color: var(--clinical-teal-dark);
  }

  .photo-stage.has-photo .bottom-toolbar {
    left: 14px;
    right: 14px;
    bottom: max(10px, env(safe-area-inset-bottom));
    gap: 6px;
    padding: 7px;
    border-radius: 26px;
    background: rgba(14, 22, 21, 0.42);
  }

  .photo-stage.has-photo .tool-button {
    min-height: 49px;
    font-size: 11px;
    color: #fff;
  }

  .photo-stage.has-photo .primary-tool {
    background: rgba(106, 183, 174, 0.95);
  }

  .has-photo .stage-guide {
    opacity: 0.12;
  }
}

/* Body-level photo state fixes v11.1 */
body:not(.has-photo) #centerGuide,
body:not(.has-photo) #flipPhoto,
body:not(.has-photo) #toggleBefore,
body:not(.has-photo) #downloadImage {
  display: none;
}

body:not(.has-photo) .bottom-toolbar .tool-button:nth-child(n+4) {
  display: none;
}

@media (max-width: 760px) {
  body:not(.has-photo) .bottom-toolbar {
    left: 22px;
    right: 22px;
    bottom: max(22px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.36);
    box-shadow: 0 18px 48px rgba(27, 54, 51, 0.2);
    backdrop-filter: blur(24px);
  }

  body:not(.has-photo) .bottom-toolbar .tool-button {
    min-height: 60px;
    border-color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.86);
    color: #183a37;
    box-shadow: 0 10px 22px rgba(27, 54, 51, 0.12);
  }

  body.has-photo .bottom-toolbar {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

/* Guided capture, help sheet, and precision edit flow v13 */
.intro-actions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(17.5% + 86px);
  display: flex;
  justify-content: center;
}

.intro-help {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 780;
  backdrop-filter: blur(14px);
}

.help-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.help-sheet.is-open {
  display: block;
}

.help-scrim {
  position: absolute;
  inset: 0;
  background: rgba(18, 28, 27, 0.36);
  backdrop-filter: blur(8px);
}

.help-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(78dvh, 720px);
  overflow: auto;
  border-radius: 24px 24px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 -26px 70px rgba(26, 43, 41, 0.24);
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  animation: sheetUp 220ms ease-out;
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  margin: 0 auto 16px;
  background: rgba(45, 35, 32, 0.18);
}

.help-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.guide-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-steps li {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid rgba(35, 118, 111, 0.12);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(232, 247, 244, 0.56));
  padding: 12px;
}

.guide-steps strong {
  color: var(--clinical-teal-dark);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.guide-steps span,
.sheet-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.sheet-note {
  margin: 14px 0 0;
}

body.photo-edit-mode .photo-stage {
  cursor: move;
}

body.photo-edit-mode .photo-stage::after {
  content: "Photo mode: move or pinch the image";
  pointer-events: none;
  position: fixed;
  left: 50%;
  top: calc(72px + env(safe-area-inset-top));
  z-index: 7;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(18, 32, 31, 0.46);
  color: #fff;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 760;
  backdrop-filter: blur(12px);
}


@media (max-width: 760px) {

  .has-photo .stage-guide {
    opacity: 0.26;
  }

  .has-photo .guide-center {
    height: 76%;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.82), transparent);
  }

  .has-photo .guide-mouth {
    opacity: 0.9;
  }

  .camera-modal.is-open {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    background: #111b1a;
  }

  .camera-card {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    background: #111b1a;
    padding: 0;
  }

  .camera-header {
    position: absolute;
    left: 16px;
    right: 16px;
    top: calc(12px + env(safe-area-inset-top));
    z-index: 3;
    color: #fff;
  }

  .camera-card video {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    object-fit: cover;
  }

  .camera-guide {
    inset: 0;
    z-index: 2;
  }

  .camera-guide .camera-guide-face {
    width: min(72%, 360px);
  }

  .camera-guide .camera-guide-mouth {
    top: 58%;
    width: min(56%, 290px);
    height: 7.4%;
  }

  .camera-guide .camera-guide-nose {
    top: 42%;
  }

  .camera-guide .camera-guide-chin {
    top: 72%;
  }

  .camera-actions {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 3;
    justify-content: center;
  }

  .camera-actions .secondary-button,
  .camera-actions .primary-button {
    min-height: 54px;
    flex: 1;
    background: rgba(255, 255, 255, 0.88);
    color: #183a37;
  }

  .camera-card > .medical-note {
    display: none;
  }
}

/* Clean landing screen and working capture buttons v16 */
body:not(.has-photo) .photo-stage > .stage-guide {
  display: none !important;
}

body:not(.has-photo) .photo-stage {
  background:
    linear-gradient(180deg, rgba(9, 27, 26, 0.2), rgba(9, 27, 26, 0.44)),
    linear-gradient(145deg, #8fc8c0 0%, #eef8f5 48%, #d98673 100%);
}

body:not(.has-photo) .empty-state {
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.28), transparent 18rem),
    linear-gradient(180deg, rgba(18, 46, 44, 0.16), rgba(18, 46, 44, 0.34));
}

body:not(.has-photo) .empty-state h3 {
  top: 19%;
  font-size: 38px;
  font-weight: 860;
  letter-spacing: 0;
}

body:not(.has-photo) .empty-state p {
  top: calc(19% + 54px);
  left: 11%;
  right: 11%;
  max-width: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.35;
}

body:not(.has-photo) .intro-actions {
  top: calc(19% + 120px);
}

body:not(.has-photo) .intro-help {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

@media (max-width: 760px) {
  body:not(.has-photo) .bottom-toolbar {
    bottom: max(24px, env(safe-area-inset-bottom));
  }

  body:not(.has-photo) .bottom-toolbar .tool-button {
    min-height: 62px;
  }
}

/* Precision edit pass v20 */
.hidden-capture-input {
  display: none;
}

.photo-stage.has-photo > .stage-guide {
  display: none !important;
}

.tool-button.is-active {
  border-color: rgba(126, 226, 214, 0.72);
  background: rgba(126, 226, 214, 0.24);
  color: #fff;
}

.pair-chip {
  display: grid;
  align-content: center;
  gap: 1px;
  min-height: 44px;
  line-height: 1.05;
}

.pair-number {
  font-size: 12px;
  font-weight: 860;
}

.pair-name {
  color: rgba(255, 250, 246, 0.72);
  font-size: 8.5px;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.pair-chip.is-active .pair-name {
  color: rgba(31, 52, 50, 0.72);
}

body.photo-edit-mode .photo-stage::after {
  content: "Photo: drag or pinch to align face";
}

body.teeth-edit-mode .photo-stage::after,
body.line-edit-mode .photo-stage::after {
  pointer-events: none;
  position: fixed;
  left: 50%;
  top: calc(72px + env(safe-area-inset-top));
  z-index: 7;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(18, 32, 31, 0.46);
  color: #fff;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 760;
  backdrop-filter: blur(12px);
}

body.teeth-edit-mode .photo-stage::after {
  content: "Teeth: drag, pinch, rotate, or resize selected pair";
}

body.line-edit-mode .photo-stage::after {
  content: "Lines: drag eye or teeth guide";
}

@media (max-width: 760px) {
}

/* Camera capture cross guide v21 */
.camera-guide {
  pointer-events: none;
  position: absolute;
  inset: 0 !important;
  z-index: 2;
  display: block !important;
}

.camera-guide span {
  display: none !important;
}

.camera-guide::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.92) 14%, rgba(255, 255, 255, 0.92) 86%, transparent);
  box-shadow: 0 0 10px rgba(21, 34, 33, 0.35), 0 0 18px rgba(255, 255, 255, 0.2);
}

.camera-guide::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.9) 10%, rgba(255, 255, 255, 0.9) 90%, transparent);
  box-shadow: 0 0 10px rgba(21, 34, 33, 0.35), 0 0 18px rgba(255, 255, 255, 0.2);
}


/* Pre-capture guide fallback v22 */
.camera-card.is-fallback video {
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.14), transparent 18rem),
    linear-gradient(180deg, #102321, #172f2d 54%, #0d1716);
}

.camera-card.is-fallback::after {
  content: "Guided lines must appear before capture. This browser is blocking live camera on this address. Use HTTPS or app mode for guided capture.";
  position: absolute;
  left: 24px;
  right: 24px;
  top: calc(20% + 22px);
  z-index: 4;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(9, 21, 20, 0.62);
  color: #fff;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  backdrop-filter: blur(12px);
}

.camera-card.is-fallback #switchCamera {
  display: none;
}

.camera-card.is-fallback .camera-actions {
  z-index: 5;
}


/* Real camera preview only v23 */
.camera-card.is-fallback::after {
  content: none !important;
  display: none !important;
}


/* Camera orientation correction v24 */
#cameraVideo {
  transform-origin: center center;
}

#cameraVideo.is-orientation-corrected {
  transform: scaleX(-1);
}


/* Camera capture controls v25 */
.camera-guide::before {
  top: 25%;
}

.camera-guide .camera-guide-mouth {
  display: block !important;
  position: absolute;
  left: calc(50% + 12px);
  top: calc(25% + 5px);
  width: auto !important;
  height: auto !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(8, 20, 19, 0.42) !important;
  box-shadow: none !important;
  padding: 2px 5px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 9px;
  font-weight: 720;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.camera-guide .camera-guide-mouth::before {
  content: "Eye position";
}

.camera-card .camera-header .ghost-button {
  display: none !important;
}

.camera-capture-bar {
  display: grid;
  grid-template-columns: 64px minmax(92px, 1fr) 64px;
  align-items: center;
  justify-items: center;
  gap: 22px;
  width: min(360px, calc(100% - 36px));
  margin-inline: auto;
}

.camera-round-button,
.camera-shutter-button {
  appearance: none;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 0;
  color: transparent;
}

.camera-round-button {
  position: relative;
  width: 54px;
  height: 54px;
  border: 1.5px solid rgba(255, 255, 255, 0.42);
  background: rgba(9, 18, 18, 0.34);
  backdrop-filter: blur(12px);
}

.camera-back-button::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 18px;
  width: 15px;
  height: 15px;
  border-left: 2.5px solid rgba(255, 255, 255, 0.94);
  border-bottom: 2.5px solid rgba(255, 255, 255, 0.94);
  transform: rotate(45deg);
}

.camera-switch-button::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 15px;
  width: 22px;
  height: 22px;
  border: 2.3px solid rgba(255, 255, 255, 0.94);
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(35deg);
}

.camera-switch-button::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 16px;
  width: 0;
  height: 0;
  border-left: 7px solid rgba(255, 255, 255, 0.94);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transform: rotate(35deg);
}

.camera-shutter-button {
  width: 82px;
  height: 82px;
  border: 5px solid rgba(255, 255, 255, 0.96);
  background: #d74f45;
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.26),
    inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.camera-shutter-button:active {
  transform: scale(0.96);
}

@media (max-width: 760px) {
  .camera-capture-bar {
    position: absolute;
    left: 50%;
    right: auto;
    bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 3;
    transform: translateX(-50%);
    width: min(350px, calc(100vw - 34px));
    margin: 0;
  }

  .camera-actions.camera-capture-bar .secondary-button,
  .camera-actions.camera-capture-bar .primary-button,
  .camera-actions.camera-capture-bar .camera-round-button,
  .camera-actions.camera-capture-bar .camera-shutter-button {
    flex: none;
  }
}


/* Fixed post-capture alignment guide v26 */
.photo-stage.has-photo > .stage-guide {
  display: none !important;
}


/* Top Image Teeth edit switch v27 */
.topbar {
  position: relative;
  overflow: visible;
}

.top-edit-switch {
  display: none;
}

body.has-photo .top-edit-switch {
  position: absolute;
  left: 50%;
  bottom: -18px;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(2, minmax(82px, 1fr));
  gap: 4px;
  transform: translateX(-50%);
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(15, 28, 27, 0.42);
  box-shadow: 0 16px 36px rgba(11, 26, 24, 0.18);
  backdrop-filter: blur(18px);
}

.mode-toggle {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 250, 246, 0.82);
  padding: 0 16px;
  font-size: 12px;
  font-weight: 820;
}

.mode-toggle.is-active {
  background: rgba(255, 255, 255, 0.92);
  color: #173b38;
  box-shadow: 0 8px 18px rgba(6, 22, 20, 0.14);
}



@media (max-width: 760px) {
  body.has-photo .top-edit-switch {
    top: calc(50px + env(safe-area-inset-top));
    bottom: auto;
    grid-template-columns: repeat(2, minmax(80px, 1fr));
  }

  body.has-photo .photo-stage::after {
    top: calc(136px + env(safe-area-inset-top));
  }

  body.has-photo.teeth-edit-mode .photo-stage::after {
    content: "Teeth: drag, pinch, rotate, or adjust smile curve";
  }
}


/* Compact icon edit switch and mobile topbar fix v28 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.icon-image::before {
  left: 3px;
  top: 5px;
  width: 16px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-image::after {
  left: 6px;
  top: 12px;
  width: 10px;
  height: 6px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: skewX(-28deg);
}

.icon-tooth::before {
  left: 4px;
  top: 3px;
  width: 14px;
  height: 17px;
  border: 2px solid currentColor;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-bottom-left-radius: 9px 12px;
  border-bottom-right-radius: 9px 12px;
  transform: rotate(-5deg);
}

.icon-tooth::after {
  left: 10px;
  top: 5px;
  width: 1.5px;
  height: 12px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.55;
}

.icon-mode-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
}

.icon-mode-toggle .line-icon {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
}

body.has-photo .top-edit-switch {
  grid-template-columns: repeat(2, 38px);
  gap: 5px;
  padding: 4px;
}

body:not(.has-photo) .top-edit-switch,

body:not(.has-photo) .photo-stage::after {
  content: none !important;
  display: none !important;
}

@media (max-width: 760px) {
  .topbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 14;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 12px 42px;
    color: #fffaf6;
    background: linear-gradient(rgba(18, 31, 30, 0.58), rgba(18, 31, 30, 0));
    pointer-events: none;
  }

  .topbar h1,
  .topbar .ghost-button,
  .top-edit-switch {
    pointer-events: auto;
  }

  body:not(.has-photo) .topbar {
    padding-bottom: 12px;
  }

  body.has-photo .top-edit-switch {
    position: fixed;
    top: calc(72px + env(safe-area-inset-top));
    left: 50%;
    bottom: auto;
    z-index: 16;
    transform: translateX(-50%);
    width: auto;
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(12, 25, 24, 0.34);
  }

  body.has-photo .photo-stage::after {
    top: calc(158px + env(safe-area-inset-top));
  }

  body:not(.has-photo) .bottom-toolbar {
    bottom: max(58px, calc(18px + env(safe-area-inset-bottom)));
  }
}


/* Refined top icons and hidden side menus v29 */
.icon-image::before {
  left: 7px;
  top: 3px;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  transform: none;
}

.icon-image::after {
  left: 3px;
  top: 13px;
  width: 16px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 11px 11px 0 0;
  transform: none;
}

.icon-tooth::before {
  left: 2px;
  top: 5px;
  width: 18px;
  height: 13px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 18px 18px;
  transform: none;
}

.icon-tooth::after {
  left: 6px;
  top: 7px;
  width: 1.5px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 4px 0 0 currentColor, 8px 0 0 currentColor;
  opacity: 0.58;
}


@media (max-width: 760px) {
  body.has-photo .top-edit-switch {
    top: calc(56px + env(safe-area-inset-top));
  }

  body.has-photo .photo-stage::after {
    top: calc(142px + env(safe-area-inset-top));
  }
}




/* Auto lip mask layering v31 */
body.has-photo.teeth-edit-mode .photo-stage::after {
  content: "Teeth: auto lip mask on Set, then drag or pinch";
}


/* Lip curtain natural layering v32 */
body.has-photo.teeth-edit-mode .photo-stage::after {
  content: "Teeth: Set hides edges behind lips";
}


/* Mouth press selection and simplified controls v33 */

.camera-guide::before {
  top: 40% !important;
}

.camera-guide .camera-guide-mouth {
  top: calc(40% + 5px) !important;
}

body.has-photo.photo-edit-mode .photo-stage::after,
body.has-photo.teeth-edit-mode .photo-stage::after,
body.has-photo.line-edit-mode .photo-stage::after {
  top: calc(104px + env(safe-area-inset-top)) !important;
}

body.has-photo.teeth-edit-mode .photo-stage::after {
  content: "Hold inside mouth to cut lip layer";
}


/* Precise mouth press selection and iOS long-press guard v34 */
html,
body,
.app-shell,
.photo-stage,
#smileCanvas,
.camera-modal,
.camera-view {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#smileCanvas,
.photo-stage canvas,
.photo-stage img,
.camera-view video {
  -webkit-user-drag: none;
  user-drag: none;
}

body.mouth-pressing,
body.mouth-pressing * {
  cursor: crosshair;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}


/* Always-respond mouth press feedback v35 */
body.has-photo.teeth-edit-mode.mouth-pressing .photo-stage::after {
  content: "Hold steady";
}

body.has-photo.teeth-edit-mode.mouth-cutout-active .photo-stage::after {
  content: "Mouth cut set";
  background: rgba(19, 79, 73, 0.76);
  border-color: rgba(126, 226, 214, 0.48);
}


/* Layer-first mouth cut workflow v36 */
body.has-photo.teeth-edit-mode:not(.mouth-layer-ready) .photo-stage::after {
  content: "Hold inside mouth to define lip layer";
}

body.has-photo.teeth-edit-mode.mouth-layer-ready:not(.teeth-preview-visible) .photo-stage::after {
  content: "Mouth layer set. Tap Preview";
  background: rgba(19, 79, 73, 0.72);
  border-color: rgba(126, 226, 214, 0.44);
}

body.has-photo.teeth-edit-mode.teeth-preview-visible .photo-stage::after {
  content: "Teeth preview on";
}

body.has-photo.teeth-edit-mode.mouth-cutout-active .photo-stage::after {
  content: attr(data-layer-message);
  background: rgba(19, 79, 73, 0.78);
  border-color: rgba(126, 226, 214, 0.52);
}


/* Manual 10-point mouth layer tool v37 */
body.has-photo.mouth-edit-mode .photo-stage::after {
  content: "Mouth: tap 10 points along inner lip line";
  background: rgba(19, 79, 73, 0.72);
  border-color: rgba(126, 226, 214, 0.42);
}

body.has-photo.mouth-edit-mode.mouth-layer-ready .photo-stage::after {
  content: "Mouth layer ready. Tap Preview";
}

body.has-photo.mouth-edit-mode .tool-button#flipPhoto {
  border-color: rgba(126, 226, 214, 0.88);
}


/* Smaller mouth points and tappable surface color v38 */
body.has-photo.mouth-edit-mode.mouth-layer-ready .photo-stage::after {
  content: "Mouth layer ready. Tap area to tint, or Preview";
}


/* Completed mouth surface tint feedback v39 */
body.has-photo.mouth-edit-mode.mouth-cutout-active .photo-stage::after {
  content: attr(data-layer-message);
  background: rgba(19, 79, 73, 0.82);
  border-color: rgba(126, 226, 214, 0.56);
}


/* Photo-bound mouth layer v40 */
body.has-photo.mouth-edit-mode.mouth-layer-ready .photo-stage::after {
  content: "Mouth layer locked to photo. Tap area to tint, or Preview";
}


/* Confirmed mouth layer brightness v41 */
body.has-photo.mouth-edit-mode.mouth-layer-confirmed .photo-stage::after {
  content: "Mouth layer confirmed. Tap Preview";
  background: rgba(19, 79, 73, 0.78);
  border-color: rgba(126, 226, 214, 0.52);
}


/* Confirmed mouth undo icon v42 */
.mouth-layer-undo {
  position: absolute;
  z-index: 11;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: #123e3a;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(126, 226, 214, 0.7);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(15, 32, 30, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px) scale(0.96);
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}

.mouth-layer-undo svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mouth-layer-undo.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.mouth-layer-undo:active {
  background: rgba(232, 252, 248, 0.96);
  transform: translateY(1px) scale(0.98);
}


/* Visible surface confirm hit area v43 */
body.has-photo.mouth-edit-mode.mouth-layer-ready:not(.mouth-layer-confirmed) .photo-stage::after {
  content: "Tap blue area to confirm";
}


/* Premium tooth template drawer v45 */
.template-library {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 19;
  display: none;
  pointer-events: none;
  transform: translateY(calc(-100% + 34px));
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.has-photo .template-library {
  display: block;
}

.template-library.is-open {
  transform: translateY(0);
}

.template-library-panel {
  pointer-events: auto;
  width: min(720px, calc(100vw - 18px));
  max-height: min(43dvh, 380px);
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background:
    linear-gradient(180deg, rgba(252, 255, 253, 0.92), rgba(238, 249, 246, 0.82)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 70px rgba(8, 25, 23, 0.24);
  color: #173b38;
  backdrop-filter: blur(22px) saturate(1.2);
}

.template-library-header,
.template-preview-row,
.template-copy {
  display: flex;
  align-items: center;
}

.template-library-header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.template-library-header .eyebrow {
  margin-bottom: 2px;
  color: #23766f;
  font-size: 9px;
}

.template-library-header h3 {
  font-size: 16px;
  line-height: 1.1;
}

.template-apply-button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: #23766f;
  color: #fff;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 820;
  box-shadow: 0 10px 24px rgba(35, 118, 111, 0.24);
}

.template-preview-row {
  justify-content: center;
  gap: 8px;
}

.template-preview-frame {
  position: relative;
  overflow: hidden;
  width: min(430px, 68vw);
  height: 136px;
  border: 1px solid rgba(35, 118, 111, 0.18);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255,255,255,0.9), rgba(255,255,255,0.2) 52%, rgba(106,183,174,0.08)),
    rgba(255, 255, 255, 0.5);
  padding: 0;
  touch-action: pan-y;
}

.template-preview-frame img {
  position: absolute;
  inset: 14px 24px;
  width: calc(100% - 48px);
  height: calc(100% - 28px);
  object-fit: contain;
  opacity: 0.28;
  filter: saturate(0.72) contrast(0.96) brightness(1.08);
}

.template-preview-frame canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.template-nav-button {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 54px;
  border: 1px solid rgba(35, 118, 111, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #23766f;
}

.template-nav-button span::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 20px;
  width: 11px;
  height: 11px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.template-nav-next span::before {
  left: 9px;
  transform: rotate(-135deg);
}

.template-copy {
  justify-content: center;
  gap: 9px;
  min-height: 24px;
  margin: 6px 0 8px;
  text-align: center;
}

.template-copy strong {
  font-size: 14px;
  line-height: 1;
}

.template-copy span {
  color: rgba(23, 59, 56, 0.68);
  font-size: 11px;
  font-weight: 680;
}

.template-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.template-card {
  display: grid;
  min-width: 0;
  min-height: 62px;
  align-content: center;
  gap: 2px;
  border: 1px solid rgba(35, 118, 111, 0.13);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.44);
  color: rgba(23, 59, 56, 0.72);
  padding: 4px 3px 5px;
}

.template-card canvas {
  width: 100%;
  height: 34px;
}

.template-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 780;
  line-height: 1;
}

.template-card.is-active {
  border-color: rgba(35, 118, 111, 0.52);
  background: rgba(255, 255, 255, 0.86);
  color: #173b38;
  box-shadow: inset 0 0 0 1px rgba(126, 226, 214, 0.28), 0 8px 20px rgba(20, 60, 56, 0.1);
}

.template-card.is-applied::after {
  content: "";
  justify-self: center;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #23766f;
}

.template-library-tab {
  pointer-events: auto;
  display: grid;
  place-items: center;
  gap: 3px;
  width: 74px;
  height: 34px;
  margin: -1px auto 0;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: rgba(248, 255, 252, 0.9);
  color: #23766f;
  box-shadow: 0 12px 28px rgba(8, 25, 23, 0.18);
  backdrop-filter: blur(16px);
  touch-action: none;
}

.template-tab-grip {
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: rgba(35, 118, 111, 0.28);
}

.template-tab-arrow {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.template-library.is-open .template-tab-arrow {
  transform: rotate(-135deg);
}

@media (max-width: 760px) {
  .template-library-panel {
    width: calc(100vw - 12px);
    max-height: min(42dvh, 350px);
    padding: calc(9px + env(safe-area-inset-top)) 10px 12px;
  }

  .template-preview-frame {
    width: min(318px, 68vw);
    height: 104px;
  }

  .template-strip {
    gap: 4px;
  }

  .template-card {
    min-height: 54px;
    border-radius: 8px;
  }

  .template-card canvas {
    height: 29px;
  }

  .template-card span {
    font-size: 8px;
  }

  .template-copy {
    margin: 5px 0 7px;
  }

  .template-copy span {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}


/* Full-screen landing hero v46 */
body:not(.has-photo) .topbar,
body:not(.has-photo) .floating-tools {
  display: none !important;
}

body:not(.has-photo) .photo-stage {
  background: #101211;
}

.landing-hero {
  overflow: hidden;
  place-content: stretch;
  justify-items: stretch;
  padding: 0;
  text-align: left;
  background: #101211;
}

.landing-portrait,
.landing-shade,
.landing-copy,
.landing-mark,
.landing-actions {
  position: absolute;
}

.landing-portrait {
  right: 0;
  bottom: 0;
  width: min(74vw, 820px);
  height: min(78vh, 980px);
  object-fit: cover;
  object-position: 68% 100%;
  opacity: 0.94;
  filter: grayscale(1) contrast(1.06) brightness(0.88);
}

.landing-shade {
  inset: 0;
  background:
    linear-gradient(180deg, rgba(16,18,17,0.96) 0%, rgba(16,18,17,0.78) 34%, rgba(16,18,17,0.34) 66%, rgba(16,18,17,0.84) 100%),
    linear-gradient(90deg, #101211 0%, rgba(16,18,17,0.96) 34%, rgba(16,18,17,0.3) 72%, rgba(16,18,17,0.08) 100%);
}

.landing-copy {
  left: clamp(24px, 7vw, 96px);
  right: clamp(24px, 32vw, 520px);
  top: clamp(66px, 12vh, 150px);
  z-index: 2;
  color: #f7f7f1;
}

.landing-kicker {
  margin: 0 0 14px;
  color: rgba(181, 230, 222, 0.76);
  font-size: clamp(11px, 1.4vw, 15px);
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.landing-copy h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(42px, 8vw, 96px);
  font-weight: 820;
  letter-spacing: 0;
  line-height: 0.94;
}

.landing-copy h3 span,
.landing-copy p span {
  display: block;
}

.landing-copy h3 span + span {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.62em;
  font-weight: 680;
}

.landing-copy > p:not(.landing-kicker) {
  max-width: 430px;
  margin: 24px 0 0;
  color: rgba(247, 247, 241, 0.76);
  font-size: clamp(15px, 2.2vw, 22px);
  font-weight: 520;
  line-height: 1.34;
}

.landing-mark {
  left: clamp(28px, 8vw, 112px);
  bottom: clamp(150px, 20vh, 240px);
  z-index: 2;
  width: clamp(118px, 19vw, 230px);
  height: auto;
  opacity: 0.94;
  filter: drop-shadow(0 20px 34px rgba(0, 0, 0, 0.42));
}

.landing-actions {
  left: clamp(24px, 7vw, 96px);
  right: clamp(24px, 7vw, 96px);
  bottom: max(34px, calc(24px + env(safe-area-inset-bottom)));
  z-index: 3;
  display: flex;
  gap: 12px;
  align-items: center;
}

.landing-start,
.landing-how {
  min-height: 52px;
  border-radius: 999px;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 820;
}

.landing-start {
  min-width: 142px;
  border: 0;
  background: linear-gradient(180deg, #ffffff, #e7f6f2);
  color: #123e3a;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

.landing-how {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

.landing-hidden-input {
  display: none;
}

@media (max-width: 760px) {
  .landing-portrait {
    right: -26vw;
    width: 96vw;
    height: 66vh;
  }

  .landing-copy {
    left: 24px;
    right: 24px;
    top: max(62px, calc(52px + env(safe-area-inset-top)));
  }

  .landing-copy h3 {
    font-size: clamp(40px, 13vw, 64px);
    max-width: 92vw;
  }

  .landing-copy h3 span + span {
    font-size: 0.58em;
  }

  .landing-copy > p:not(.landing-kicker) {
    max-width: 295px;
    margin-top: 18px;
    font-size: 16px;
  }

  .landing-mark {
    left: 28px;
    bottom: max(142px, calc(116px + env(safe-area-inset-bottom)));
    width: clamp(116px, 30vw, 154px);
  }

  .landing-actions {
    left: 20px;
    right: 20px;
    bottom: max(26px, calc(18px + env(safe-area-inset-bottom)));
  }

  .landing-start,
  .landing-how {
    flex: 1;
    min-width: 0;
    min-height: 56px;
    padding: 0 12px;
  }
}


/* Landing typography polish v47 */
:root {
  --landing-display-font: "Avenir Next", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --landing-text-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

body:not(.has-photo) .landing-hero {
  font-family: var(--landing-text-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body:not(.has-photo) .landing-copy {
  width: min(82vw, 560px);
  left: clamp(22px, 6vw, 70px);
  top: clamp(70px, 11vh, 132px);
  gap: clamp(12px, 1.6vh, 18px);
  font-family: var(--landing-display-font);
  color: rgba(255, 255, 250, 0.96);
}

body:not(.has-photo) .landing-kicker {
  font-family: var(--landing-text-font);
  font-size: clamp(10px, 1.45vw, 13px);
  font-weight: 760;
  letter-spacing: 0.18em;
  line-height: 1.15;
  color: rgba(242, 245, 239, 0.7);
  text-transform: uppercase;
}

body:not(.has-photo) .landing-copy h3 {
  max-width: 9.2em;
  margin: 0;
  font-family: var(--landing-display-font);
  font-size: clamp(42px, 9.4vw, 82px);
  font-weight: 760;
  line-height: 0.94;
  letter-spacing: 0;
  text-wrap: balance;
  color: rgba(255, 255, 250, 0.98);
  text-shadow: 0 18px 44px rgba(0, 0, 0, 0.44);
}

body:not(.has-photo) .landing-copy h3 span {
  display: block;
}

body:not(.has-photo) .landing-copy h3 span + span {
  margin-top: 0.12em;
  font-family: var(--landing-text-font);
  font-size: 0.56em;
  font-weight: 620;
  line-height: 1.04;
  color: rgba(244, 244, 238, 0.88);
}

body:not(.has-photo) .landing-copy > p:not(.landing-kicker) {
  max-width: 19em;
  margin: clamp(2px, 0.5vh, 8px) 0 0;
  font-family: var(--landing-text-font);
  font-size: clamp(16px, 3.6vw, 22px);
  font-weight: 470;
  line-height: 1.38;
  letter-spacing: 0.01em;
  color: rgba(245, 246, 240, 0.76);
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
}

body:not(.has-photo) .landing-actions {
  left: clamp(22px, 6vw, 70px);
  right: auto;
  bottom: max(34px, env(safe-area-inset-bottom));
  width: min(82vw, 430px);
  grid-template-columns: 1.08fr 0.92fr;
  gap: 12px;
}

body:not(.has-photo) .landing-start,
body:not(.has-photo) .landing-how {
  min-height: 56px;
  border-radius: 999px;
  font-family: var(--landing-text-font);
  font-size: clamp(15px, 3.6vw, 18px);
  font-weight: 720;
  letter-spacing: 0.01em;
}

body:not(.has-photo) .landing-start {
  background: linear-gradient(135deg, rgba(255, 255, 250, 0.98), rgba(218, 225, 218, 0.9));
  color: #111716;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.35);
}

body:not(.has-photo) .landing-how {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.11);
  color: rgba(255, 255, 250, 0.94);
  backdrop-filter: blur(14px);
}

body:not(.has-photo) .landing-mark {
  width: clamp(122px, 24vw, 188px);
  left: clamp(28px, 7vw, 82px);
  bottom: clamp(124px, 18vh, 210px);
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.38));
}

@media (max-width: 430px) {
  body:not(.has-photo) .landing-copy {
    top: clamp(58px, 9vh, 96px);
  }

  body:not(.has-photo) .landing-copy h3 {
    font-size: clamp(40px, 10.2vw, 54px);
  }

  body:not(.has-photo) .landing-copy > p:not(.landing-kicker) {
    font-size: clamp(15px, 4.1vw, 18px);
  }

  body:not(.has-photo) .landing-mark {
    width: clamp(108px, 31vw, 142px);
    bottom: clamp(118px, 17vh, 168px);
  }

  body:not(.has-photo) .landing-actions {
    width: calc(100vw - 42px);
    grid-template-columns: 1fr 1fr;
  }
}


/* Landing mobile polish v48 */
body:not(.has-photo) .stage-guide {
  display: none !important;
}

body:not(.has-photo) .landing-hero {
  background: #0d100f;
}

body:not(.has-photo) .landing-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  width: min(78vw, 540px);
  left: clamp(28px, 8vw, 86px);
  top: clamp(72px, 10vh, 120px);
  z-index: 4;
}

body:not(.has-photo) .landing-kicker {
  margin: 0;
  color: rgba(204, 211, 206, 0.74);
  font-size: clamp(10px, 1.3vw, 12px);
  font-weight: 760;
  letter-spacing: 0.16em;
}

body:not(.has-photo) .landing-copy h3 {
  max-width: 7.7em;
  margin: 0;
  font-family: "Avenir Next", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(46px, 9.8vw, 76px);
  font-weight: 820;
  line-height: 0.98;
  letter-spacing: 0;
  color: rgba(255, 255, 250, 0.97);
}

body:not(.has-photo) .landing-copy h3 span + span {
  margin-top: 0.22em;
  font-size: 0.5em;
  font-weight: 650;
  line-height: 1.08;
  color: rgba(223, 225, 218, 0.9);
}

body:not(.has-photo) .landing-copy > p:not(.landing-kicker) {
  max-width: 18em;
  margin: 2px 0 0;
  color: rgba(221, 224, 218, 0.78);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(17px, 3.2vw, 22px);
  font-weight: 520;
  line-height: 1.38;
  letter-spacing: 0;
}

body:not(.has-photo) .landing-portrait {
  right: -2vw;
  bottom: 0;
  width: min(78vw, 760px);
  height: min(64vh, 820px);
  object-fit: cover;
  object-position: 52% 100%;
  opacity: 0.86;
  filter: grayscale(1) contrast(1.05) brightness(0.78);
}

body:not(.has-photo) .landing-shade {
  background:
    linear-gradient(180deg, rgba(13,16,15,0.96) 0%, rgba(13,16,15,0.82) 28%, rgba(13,16,15,0.45) 60%, rgba(13,16,15,0.88) 100%),
    linear-gradient(90deg, #0d100f 0%, rgba(13,16,15,0.94) 32%, rgba(13,16,15,0.34) 72%, rgba(13,16,15,0.08) 100%);
}

body:not(.has-photo) .landing-mark {
  width: clamp(82px, 17vw, 128px);
  left: clamp(28px, 7vw, 72px);
  bottom: clamp(112px, 15vh, 172px);
  opacity: 0.58;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.3));
}

body:not(.has-photo) .landing-actions {
  left: clamp(20px, 6vw, 64px);
  right: clamp(20px, 6vw, 64px);
  bottom: max(26px, calc(18px + env(safe-area-inset-bottom)));
  width: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

body:not(.has-photo) .landing-start,
body:not(.has-photo) .landing-how {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: clamp(15px, 3.8vw, 17px);
  font-weight: 760;
  letter-spacing: 0;
}

body:not(.has-photo) .landing-start {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

@media (max-width: 430px) {
  body:not(.has-photo) .landing-copy {
    width: calc(100vw - 48px);
    left: 26px;
    top: max(54px, calc(38px + env(safe-area-inset-top)));
    gap: 12px;
  }

  body:not(.has-photo) .landing-copy h3 {
    max-width: 6.6em;
    font-size: clamp(46px, 13.2vw, 58px);
    line-height: 0.98;
  }

  body:not(.has-photo) .landing-copy h3 span + span {
    margin-top: 0.22em;
    font-size: 0.48em;
    line-height: 1.1;
  }

  body:not(.has-photo) .landing-copy > p:not(.landing-kicker) {
    max-width: 16.2em;
    font-size: clamp(17px, 4.5vw, 19px);
    line-height: 1.34;
  }

  body:not(.has-photo) .landing-portrait {
    right: -5vw;
    width: 92vw;
    height: 58vh;
    object-position: 50% 100%;
    opacity: 0.84;
  }

  body:not(.has-photo) .landing-mark {
    width: clamp(76px, 24vw, 104px);
    left: 28px;
    bottom: max(104px, calc(88px + env(safe-area-inset-bottom)));
    opacity: 0.56;
  }

  body:not(.has-photo) .landing-actions {
    left: 18px;
    right: 18px;
    bottom: max(22px, calc(14px + env(safe-area-inset-bottom)));
    gap: 10px;
  }

  body:not(.has-photo) .landing-start,
  body:not(.has-photo) .landing-how {
    min-height: 48px;
    font-size: 16px;
  }
}


/* Landing headline repair v49 */
body:not(.has-photo) .photo-stage > .stage-guide,
body:not(.has-photo) .photo-stage > .stage-guide * {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

body:not(.has-photo) .landing-hero {
  isolation: isolate;
  background: #0b0e0d !important;
}

body:not(.has-photo) .landing-portrait {
  top: 0 !important;
  right: -10vw !important;
  bottom: auto !important;
  width: min(108vw, 720px) !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: 58% 100% !important;
  opacity: 0.92 !important;
  filter: grayscale(1) contrast(1.08) brightness(0.75) !important;
  z-index: 0 !important;
}

body:not(.has-photo) .landing-shade {
  z-index: 1 !important;
  background:
    linear-gradient(180deg, rgba(11,14,13,0.9) 0%, rgba(11,14,13,0.62) 32%, rgba(11,14,13,0.48) 62%, rgba(11,14,13,0.86) 100%),
    linear-gradient(90deg, #0b0e0d 0%, rgba(11,14,13,0.96) 34%, rgba(11,14,13,0.5) 66%, rgba(11,14,13,0.18) 100%) !important;
}

body:not(.has-photo) .landing-copy {
  position: absolute !important;
  left: clamp(28px, 7vw, 74px) !important;
  right: clamp(24px, 6vw, 70px) !important;
  top: max(58px, calc(42px + env(safe-area-inset-top))) !important;
  z-index: 5 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 0 !important;
  width: auto !important;
  max-width: 720px !important;
  padding: 0 !important;
  text-align: left !important;
}

body:not(.has-photo) .landing-kicker {
  display: none !important;
}

body:not(.has-photo) .landing-copy h3 {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: clamp(8px, 1.1vh, 14px) !important;
  width: min(100%, 620px) !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  color: #fffdf8 !important;
  text-shadow: 0 18px 44px rgba(0, 0, 0, 0.5) !important;
}

body:not(.has-photo) .landing-copy h3 span:first-child {
  display: block !important;
  max-width: 9em !important;
  font-family: "Avenir Next", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif !important;
  font-size: clamp(54px, 14vw, 104px) !important;
  font-weight: 900 !important;
  line-height: 0.88 !important;
  letter-spacing: 0.01em !important;
  text-transform: uppercase !important;
}

body:not(.has-photo) .landing-copy h3 span + span {
  display: block !important;
  max-width: 11em !important;
  margin: 0 !important;
  font-family: "Times New Roman", Times, Georgia, serif !important;
  font-size: clamp(29px, 7.4vw, 58px) !important;
  font-style: italic !important;
  font-weight: 500 !important;
  line-height: 1.02 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: rgba(238, 238, 230, 0.92) !important;
}

body:not(.has-photo) .landing-copy > p:not(.landing-kicker) {
  position: static !important;
  inset: auto !important;
  display: block !important;
  max-width: 19em !important;
  margin: clamp(20px, 3.2vh, 34px) 0 0 !important;
  padding: 0 !important;
  color: rgba(226, 229, 222, 0.84) !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif !important;
  font-size: clamp(16px, 4.2vw, 22px) !important;
  font-weight: 520 !important;
  line-height: 1.34 !important;
  letter-spacing: 0 !important;
  text-align: left !important;
  text-shadow: 0 12px 32px rgba(0, 0, 0, 0.46) !important;
}

body:not(.has-photo) .landing-copy > p:not(.landing-kicker) span {
  display: block !important;
}

body:not(.has-photo) .landing-mark {
  z-index: 4 !important;
  width: clamp(76px, 21vw, 126px) !important;
  left: clamp(24px, 7vw, 70px) !important;
  bottom: max(106px, calc(86px + env(safe-area-inset-bottom))) !important;
  opacity: 0.5 !important;
  filter: grayscale(1) brightness(0.72) drop-shadow(0 14px 26px rgba(0, 0, 0, 0.34)) !important;
}

body:not(.has-photo) .landing-actions {
  z-index: 6 !important;
  left: clamp(18px, 5vw, 54px) !important;
  right: clamp(18px, 5vw, 54px) !important;
  bottom: max(22px, calc(14px + env(safe-area-inset-bottom))) !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: clamp(10px, 3vw, 16px) !important;
  width: auto !important;
}

body:not(.has-photo) .landing-start,
body:not(.has-photo) .landing-how {
  min-height: 48px !important;
  padding: 0 14px !important;
  font-size: clamp(15px, 4vw, 18px) !important;
  font-weight: 780 !important;
  white-space: nowrap !important;
}

@media (min-width: 760px) {
  body:not(.has-photo) .landing-copy {
    top: clamp(80px, 12vh, 150px) !important;
  }

  body:not(.has-photo) .landing-copy h3 span:first-child {
    font-size: clamp(72px, 8vw, 118px) !important;
  }

  body:not(.has-photo) .landing-copy h3 span + span {
    font-size: clamp(38px, 4.5vw, 66px) !important;
  }

  body:not(.has-photo) .landing-portrait {
    right: 0 !important;
    width: min(76vw, 860px) !important;
    object-position: 54% 100% !important;
  }
}


/* Dimir wordmark v50 */
.landing-brand {
  position: absolute;
  z-index: 6;
  left: clamp(24px, 7vw, 70px);
  bottom: max(112px, calc(92px + env(safe-area-inset-bottom)));
  display: inline-flex;
  align-items: center;
  gap: clamp(14px, 3.5vw, 28px);
  pointer-events: none;
}

body:not(.has-photo) .landing-brand .landing-mark {
  position: static !important;
  width: clamp(42px, 11vw, 64px) !important;
  height: auto !important;
  opacity: 0.62 !important;
  filter: grayscale(1) brightness(0.72) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.34)) !important;
}

.landing-wordmark {
  color: rgba(190, 190, 186, 0.86);
  font-family: "Avenir Next", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(26px, 8.2vw, 56px);
  font-weight: 620;
  line-height: 1;
  letter-spacing: 0.16em;
  white-space: nowrap;
  text-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
}

@media (max-width: 430px) {
  .landing-brand {
    left: 26px;
    bottom: max(104px, calc(86px + env(safe-area-inset-bottom)));
    gap: 14px;
  }

  body:not(.has-photo) .landing-brand .landing-mark {
    width: clamp(40px, 12vw, 54px) !important;
  }

  .landing-wordmark {
    font-size: clamp(27px, 8.5vw, 38px);
    letter-spacing: 0.14em;
  }
}


/* Dimir brighter portrait v51 */
body:not(.has-photo) .landing-portrait {
  opacity: 1 !important;
  filter: grayscale(1) contrast(1.08) brightness(0.98) !important;
}

body:not(.has-photo) .landing-shade {
  background:
    linear-gradient(180deg, rgba(11,14,13,0.82) 0%, rgba(11,14,13,0.5) 30%, rgba(11,14,13,0.34) 62%, rgba(11,14,13,0.78) 100%),
    linear-gradient(90deg, #0b0e0d 0%, rgba(11,14,13,0.9) 30%, rgba(11,14,13,0.34) 61%, rgba(11,14,13,0.02) 100%) !important;
}

body:not(.has-photo) .landing-copy {
  text-shadow: 0 18px 42px rgba(0, 0, 0, 0.58) !important;
}

body:not(.has-photo) .landing-brand .landing-mark {
  opacity: 0.68 !important;
  filter: grayscale(1) brightness(0.8) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.34)) !important;
}

.landing-wordmark {
  color: rgba(205, 205, 201, 0.9) !important;
}


/* Camera capture instruction overlay v52 */
.capture-instruction-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(22px + env(safe-area-inset-top)) 18px calc(112px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.16), transparent 34%),
    rgba(8, 15, 14, 0.18);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: auto;
}

.capture-instruction-layer.is-visible {
  display: flex;
}

.capture-instruction-card {
  width: min(420px, calc(100vw - 34px));
  max-height: min(78dvh, 680px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 249, 246, 0.78)),
    rgba(255, 255, 255, 0.68);
  color: #142321;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  padding: 20px 20px 18px;
  text-align: center;
  backdrop-filter: blur(24px) saturate(1.18);
  -webkit-backdrop-filter: blur(24px) saturate(1.18);
}

.capture-instruction-header .eyebrow {
  margin: 0 0 7px;
  color: rgba(20, 35, 33, 0.58);
  letter-spacing: 0.16em;
  font-size: 0.7rem;
}

.capture-instruction-header h3 {
  margin: 0;
  color: #122421;
  font-size: clamp(1.35rem, 5vw, 1.9rem);
  line-height: 1.02;
}

.capture-instruction-diagram {
  position: relative;
  width: min(250px, 68vw);
  aspect-ratio: 0.78 / 1;
  margin: 18px auto 16px;
}

.capture-instruction-diagram span {
  position: absolute;
  display: block;
}

.diagram-face {
  inset: 6% 18% 3%;
  border: 2px solid rgba(26, 58, 54, 0.28);
  border-radius: 48% 48% 43% 43%;
}

.diagram-face::before,
.diagram-face::after {
  content: "";
  position: absolute;
  top: 31%;
  width: 20%;
  height: 8%;
  border-top: 2px solid rgba(26, 58, 54, 0.34);
  border-radius: 999px;
}

.diagram-face::before {
  left: 23%;
}

.diagram-face::after {
  right: 23%;
}

.diagram-eye-line,
.diagram-lip-line {
  left: 8%;
  right: 8%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(28, 116, 107, 0.82) 18%, rgba(28, 116, 107, 0.82) 82%, transparent);
}

.diagram-eye-line {
  top: 33%;
}

.diagram-lip-line {
  top: 62%;
  background: linear-gradient(90deg, transparent, rgba(191, 112, 96, 0.74) 18%, rgba(191, 112, 96, 0.74) 82%, transparent);
}

.diagram-center-line {
  top: 3%;
  bottom: 2%;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(25, 46, 43, 0.72) 10%, rgba(25, 46, 43, 0.72) 88%, transparent);
}

.diagram-nose {
  top: 41%;
  left: 50%;
  width: 31px;
  height: 28px;
  transform: translateX(-50%);
  border: 2px solid rgba(26, 58, 54, 0.28);
  border-top: 0;
  border-radius: 0 0 18px 18px;
}

.diagram-nose::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 2px;
  height: 17px;
  transform: translateX(-50%);
  background: rgba(25, 46, 43, 0.42);
}

.diagram-eye-label,
.diagram-center-label,
.diagram-lip-label {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(20, 35, 33, 0.68);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(22, 32, 30, 0.08);
}

.diagram-eye-label {
  top: calc(33% - 13px);
  right: 0;
}

.diagram-center-label {
  top: 5%;
  left: calc(50% + 10px);
}

.diagram-lip-label {
  top: calc(62% + 9px);
  left: 50%;
  transform: translateX(-50%);
}

.capture-instruction-copy,
.capture-instruction-subcopy {
  margin: 0 auto;
  max-width: 32ch;
  line-height: 1.38;
}

.capture-instruction-copy {
  color: #152724;
  font-size: 1rem;
  font-weight: 800;
}

.capture-instruction-subcopy {
  margin-top: 8px;
  color: rgba(20, 35, 33, 0.66);
  font-size: 0.88rem;
  font-weight: 650;
}

.capture-instruction-actions {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 10px;
  margin-top: 18px;
}

.capture-instruction-actions button {
  min-height: 46px;
  border: 1px solid rgba(20, 35, 33, 0.14);
  border-radius: 999px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  cursor: pointer;
}

.capture-instruction-secondary {
  background: rgba(255, 255, 255, 0.62);
  color: rgba(20, 35, 33, 0.72);
}

.capture-instruction-primary {
  background: #163532;
  color: #fffdfa;
  box-shadow: 0 12px 26px rgba(22, 53, 50, 0.22);
}

@media (max-width: 430px) {
  .capture-instruction-card {
    padding: 18px 16px 16px;
  }

  .capture-instruction-diagram {
    width: min(220px, 66vw);
    margin-block: 14px;
  }

  .capture-instruction-actions {
    grid-template-columns: 1fr;
  }
}


/* Camera DIMIR brand header v53 */
.camera-brand-header {
  justify-content: center;
}

.camera-brand-lockup {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  min-height: 34px;
  padding: 7px 14px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(9, 18, 17, 0.2);
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.camera-brand-name {
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0.34em;
  line-height: 1;
}

.camera-brand-version {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

@media (max-width: 760px) {
  .camera-brand-header {
    top: calc(16px + env(safe-area-inset-top)) !important;
  }

  .camera-brand-lockup {
    min-height: 32px;
    padding: 7px 13px;
  }

  .camera-brand-name {
    font-size: 0.78rem;
    letter-spacing: 0.31em;
  }

  .camera-brand-version {
    font-size: 0.52rem;
  }
}


/* Camera guide polish v54 */
.camera-brand-header {
  justify-content: space-between !important;
  align-items: flex-start !important;
}

.camera-brand-lockup {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: #ffffff !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.36);
}

.camera-brand-name {
  color: #ffffff !important;
  font-size: 0.82rem !important;
  letter-spacing: 0.32em !important;
}

.camera-brand-version {
  color: rgba(255, 255, 255, 0.74) !important;
  font-size: 0.52rem !important;
}

.camera-guide-reopen {
  min-width: 0;
  min-height: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  color: rgba(255, 255, 255, 0.94);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.capture-instruction-layer {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.1), transparent 36%),
    rgba(8, 15, 14, 0.08) !important;
  backdrop-filter: blur(1.2px) !important;
  -webkit-backdrop-filter: blur(1.2px) !important;
}

.capture-instruction-card {
  border-color: rgba(255, 255, 255, 0.26) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(246, 250, 247, 0.58)),
    rgba(255, 255, 255, 0.48) !important;
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.54) !important;
}

.diagram-face {
  inset: 4% 19% 2% !important;
  border-color: rgba(26, 58, 54, 0.36) !important;
  border-width: 2px !important;
  border-radius: 44% 44% 48% 48% / 34% 34% 58% 58% !important;
  clip-path: polygon(50% 0%, 68% 5%, 82% 18%, 90% 38%, 86% 66%, 73% 88%, 58% 98%, 42% 98%, 27% 88%, 14% 66%, 10% 38%, 18% 18%, 32% 5%);
}

.diagram-face::before,
.diagram-face::after {
  top: 31% !important;
  width: 18% !important;
  height: 5% !important;
  border: 0 !important;
  border-top: 2px solid rgba(26, 58, 54, 0.44) !important;
  border-radius: 999px !important;
}

.diagram-face::before {
  left: 23% !important;
}

.diagram-face::after {
  right: 23% !important;
}

.diagram-eye-line {
  left: 15% !important;
  right: 15% !important;
  top: 33% !important;
}

.diagram-eye-line::before,
.diagram-eye-line::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%);
  border: 2px solid rgba(28, 116, 107, 0.78);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
}

.diagram-eye-line::before {
  left: 0;
}

.diagram-eye-line::after {
  right: 0;
}

.diagram-eye-label {
  right: 3% !important;
}

.capture-instruction-subcopy {
  max-width: 34ch !important;
}

@media (max-width: 760px) {
  .camera-brand-header {
    left: 18px !important;
    right: 18px !important;
    top: calc(18px + env(safe-area-inset-top)) !important;
  }

  .camera-guide-reopen {
    padding: 7px 9px;
    font-size: 0.64rem;
  }
}


/* Smile cross guide v55 */
.capture-instruction-layer {
  background: rgba(5, 10, 10, 0.04) !important;
  backdrop-filter: blur(0.8px) !important;
  -webkit-backdrop-filter: blur(0.8px) !important;
}

.capture-instruction-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(247, 250, 248, 0.38)),
    rgba(255, 255, 255, 0.34) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 22px 62px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

.smile-cross-diagram {
  width: min(280px, 72vw) !important;
  aspect-ratio: 0.74 / 1 !important;
  margin: 16px auto 15px !important;
}

.smile-cross-diagram .diagram-device {
  inset: 0;
  border-radius: 28px;
  background: rgba(134, 137, 134, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.smile-cross-diagram .diagram-smile-face {
  left: 50%;
  top: 47%;
  width: 58%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 38%, #5f3512 0 5%, transparent 5.5%),
    radial-gradient(circle at 66% 38%, #5f3512 0 5%, transparent 5.5%),
    radial-gradient(circle at 50% 33%, rgba(255, 255, 255, 0.22), transparent 38%),
    linear-gradient(145deg, #ffe16b 0%, #f7a60f 100%);
  border: 7px solid rgba(225, 132, 0, 0.9);
  box-shadow: 0 10px 24px rgba(43, 25, 0, 0.12);
}

.smile-cross-diagram .diagram-smile-face::before {
  content: "";
  position: absolute;
  left: 21%;
  right: 21%;
  top: 57%;
  height: 22%;
  border-radius: 0 0 999px 999px;
  background:
    linear-gradient(180deg, #f8faf7 0 38%, #dfe2dd 38% 58%, transparent 58%),
    #4a270e;
  border: 6px solid #4a270e;
  border-top-width: 8px;
  overflow: hidden;
}

.smile-cross-diagram .diagram-smile-face::after {
  content: "";
  position: absolute;
  left: 40%;
  right: 40%;
  top: 78%;
  height: 7%;
  border-radius: 999px 999px 0 0;
  background: #ff5730;
}

.smile-cross-diagram .diagram-eye-line,
.smile-cross-diagram .diagram-center-line {
  z-index: 3;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.12);
}

.smile-cross-diagram .diagram-eye-line {
  left: 9% !important;
  right: 9% !important;
  top: 40% !important;
  height: 2px !important;
}

.smile-cross-diagram .diagram-eye-line::before,
.smile-cross-diagram .diagram-eye-line::after {
  content: none !important;
}

.smile-cross-diagram .diagram-center-line {
  top: 6% !important;
  bottom: 6% !important;
  left: 50% !important;
  width: 2px !important;
  transform: translateX(-50%) !important;
  border-radius: 999px;
}

.smile-cross-diagram .diagram-face,
.smile-cross-diagram .diagram-nose,
.smile-cross-diagram .diagram-lip-line,
.smile-cross-diagram .diagram-eye-label,
.smile-cross-diagram .diagram-center-label,
.smile-cross-diagram .diagram-lip-label {
  display: none !important;
}

.capture-instruction-copy {
  max-width: 31ch !important;
}

.capture-instruction-subcopy {
  max-width: 35ch !important;
}

.capture-instruction-secondary {
  background: rgba(255, 255, 255, 0.44) !important;
}

.camera-back-button::before {
  left: 16px !important;
  top: 22px !important;
  width: 22px !important;
  height: 17px !important;
  border: 2px solid rgba(255, 255, 255, 0.9) !important;
  border-top: 0 !important;
  border-radius: 2px !important;
  transform: none !important;
}

.camera-back-button::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 15px;
  width: 20px;
  height: 20px;
  border-left: 2px solid rgba(255, 255, 255, 0.9);
  border-top: 2px solid rgba(255, 255, 255, 0.9);
  transform: rotate(45deg);
}

.camera-switch-button::before {
  left: 15px !important;
  top: 17px !important;
  width: 24px !important;
  height: 17px !important;
  border: 2px solid rgba(255, 255, 255, 0.9) !important;
  border-radius: 5px !important;
  background: transparent !important;
  transform: none !important;
}

.camera-switch-button::after {
  content: "" !important;
  position: absolute !important;
  left: 22px !important;
  top: 20px !important;
  width: 10px !important;
  height: 10px !important;
  border: 2px solid rgba(255, 255, 255, 0.9) !important;
  border-left-color: transparent !important;
  border-radius: 50% !important;
  transform: none !important;
  box-shadow: 9px -5px 0 -6px transparent;
}

.camera-switch-button {
  overflow: visible;
}

.camera-switch-button .unused {
  display: none;
}


/* Guide position and transparent diagram v56 */
.capture-instruction-layer {
  align-items: flex-start !important;
  justify-content: center !important;
  padding-top: calc(88px + env(safe-area-inset-top)) !important;
  padding-bottom: calc(118px + env(safe-area-inset-bottom)) !important;
  background: rgba(5, 10, 10, 0.02) !important;
  backdrop-filter: blur(0.45px) !important;
  -webkit-backdrop-filter: blur(0.45px) !important;
}

.capture-instruction-card {
  width: min(420px, calc(100vw - 38px)) !important;
  max-height: calc(100dvh - 230px) !important;
  overflow: hidden !important;
  padding: 18px 18px 16px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(248, 250, 248, 0.28)),
    rgba(255, 255, 255, 0.24) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.34) !important;
}

.capture-instruction-header .eyebrow {
  margin-bottom: 5px !important;
}

.capture-instruction-header h3 {
  font-size: clamp(1.25rem, 4.6vw, 1.72rem) !important;
}

.smile-cross-diagram {
  width: min(265px, 70vw) !important;
  aspect-ratio: 0.86 / 1 !important;
  margin: 12px auto 12px !important;
}

.smile-cross-diagram .diagram-device {
  display: none !important;
}

.smile-cross-diagram .diagram-smile-face {
  top: 45% !important;
  width: 72% !important;
  border-width: 8px !important;
}

.smile-cross-diagram .diagram-eye-line {
  left: 2% !important;
  right: 2% !important;
  top: 45% !important;
  height: 2px !important;
}

.smile-cross-diagram .diagram-center-line {
  top: 15% !important;
  bottom: 13% !important;
  height: auto !important;
}

.capture-instruction-copy {
  max-width: 31ch !important;
  font-size: 0.96rem !important;
  line-height: 1.28 !important;
}

.capture-instruction-subcopy {
  max-width: 35ch !important;
  margin-top: 7px !important;
  font-size: 0.82rem !important;
  line-height: 1.3 !important;
}

.capture-instruction-actions {
  margin-top: 13px !important;
}

.capture-instruction-actions button {
  min-height: 42px !important;
}

@media (max-width: 430px) {
  .capture-instruction-layer {
    padding-top: calc(82px + env(safe-area-inset-top)) !important;
    padding-bottom: calc(112px + env(safe-area-inset-bottom)) !important;
  }

  .capture-instruction-card {
    max-height: calc(100dvh - 214px) !important;
    padding: 16px 16px 14px !important;
  }

  .smile-cross-diagram {
    width: min(250px, 68vw) !important;
    margin-block: 10px !important;
  }
}


/* Camera button reference icons v57 */
.camera-back-button::before,
.camera-switch-button::before {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 29px !important;
  height: 29px !important;
  transform: translate(-50%, -50%) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: none !important;
}

.camera-back-button::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M6 30.5 32 8l26 22.5-4.7 5.3L32 17.2 10.7 35.8 6 30.5Z'/%3E%3Cpath d='M14 31.5 32 16l18 15.5V56H38V40H26v16H14V31.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M6 30.5 32 8l26 22.5-4.7 5.3L32 17.2 10.7 35.8 6 30.5Z'/%3E%3Cpath d='M14 31.5 32 16l18 15.5V56H38V40H26v16H14V31.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.camera-back-button::after,
.camera-switch-button::after {
  content: none !important;
  display: none !important;
}

.camera-switch-button::before {
  width: 32px !important;
  height: 32px !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill-rule='evenodd' d='M22 14h20l4 6h8a6 6 0 0 1 6 6v24a6 6 0 0 1-6 6H10a6 6 0 0 1-6-6V26a6 6 0 0 1 6-6h8l4-6Zm2.7 6-4 6H10v24h44V26H43.3l-4-6H24.7Zm6.6 9.5a11 11 0 0 1 10.1 5.9l2.8-2.8V42H34.8l3.5-3.5a6.8 6.8 0 0 0-6.7-4.1 7 7 0 0 0-5.9 4.7l-5-1.7a12.2 12.2 0 0 1 10.6-7.9Zm-9 10.5h9.5l-3.6 3.6a6.8 6.8 0 0 0 6.8 4.1 7 7 0 0 0 5.9-4.7l5 1.7A12.2 12.2 0 0 1 35.3 52a11 11 0 0 1-10.2-6l-2.8 2.8V40Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill-rule='evenodd' d='M22 14h20l4 6h8a6 6 0 0 1 6 6v24a6 6 0 0 1-6 6H10a6 6 0 0 1-6-6V26a6 6 0 0 1 6-6h8l4-6Zm2.7 6-4 6H10v24h44V26H43.3l-4-6H24.7Zm6.6 9.5a11 11 0 0 1 10.1 5.9l2.8-2.8V42H34.8l3.5-3.5a6.8 6.8 0 0 0-6.7-4.1 7 7 0 0 0-5.9 4.7l-5-1.7a12.2 12.2 0 0 1 10.6-7.9Zm-9 10.5h9.5l-3.6 3.6a6.8 6.8 0 0 0 6.8 4.1 7 7 0 0 0 5.9-4.7l5 1.7A12.2 12.2 0 0 1 35.3 52a11 11 0 0 1-10.2-6l-2.8 2.8V40Z'/%3E%3C/svg%3E") center / contain no-repeat;
}


/* Face guide image alignment v58 */
.capture-instruction-layer {
  padding-top: calc(76px + env(safe-area-inset-top)) !important;
  padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
}

.capture-instruction-card {
  max-height: calc(100dvh - 188px) !important;
  overflow: visible !important;
  padding: 14px 16px 13px !important;
}

.capture-instruction-header .eyebrow {
  margin-bottom: 3px !important;
  font-size: 0.62rem !important;
}

.capture-instruction-header h3 {
  font-size: clamp(1.12rem, 4.2vw, 1.5rem) !important;
}

.face-guide-diagram {
  position: relative;
  width: min(245px, 64vw) !important;
  aspect-ratio: 0.8 / 1 !important;
  margin: 8px auto 10px !important;
  overflow: visible;
}

.face-guide-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.88;
  filter: invert(1) grayscale(1) contrast(1.42) brightness(0.72);
}

.face-guide-diagram .diagram-eye-line,
.face-guide-diagram .diagram-center-line {
  position: absolute;
  z-index: 4;
  display: block;
  border-radius: 999px;
  background: rgba(132, 136, 136, 0.92) !important;
  box-shadow: 0 1px 4px rgba(255, 255, 255, 0.16), 0 0 0 0.5px rgba(32, 34, 34, 0.25);
}

.face-guide-diagram .diagram-eye-line {
  left: 4% !important;
  right: 4% !important;
  top: 43.2% !important;
  height: 2px !important;
}

.face-guide-diagram .diagram-center-line {
  top: 7% !important;
  bottom: 6% !important;
  left: 50% !important;
  width: 2px !important;
  transform: translateX(-50%) !important;
}

.capture-instruction-copy {
  font-size: 0.88rem !important;
  line-height: 1.22 !important;
  max-width: 32ch !important;
}

.capture-instruction-subcopy {
  margin-top: 5px !important;
  font-size: 0.76rem !important;
  line-height: 1.24 !important;
  max-width: 36ch !important;
}

.capture-instruction-actions {
  grid-template-columns: 1.18fr 0.82fr !important;
  gap: 8px !important;
  margin-top: 10px !important;
}

.capture-instruction-actions button {
  min-height: 39px !important;
  font-size: 0.76rem !important;
}

.smile-cross-diagram .diagram-smile-face,
.smile-cross-diagram .diagram-device {
  display: none !important;
}

@media (max-width: 430px) {
  .capture-instruction-layer {
    padding-top: calc(72px + env(safe-area-inset-top)) !important;
    padding-bottom: calc(100px + env(safe-area-inset-bottom)) !important;
  }

  .capture-instruction-card {
    max-height: calc(100dvh - 176px) !important;
    padding: 13px 14px 12px !important;
  }

  .face-guide-diagram {
    width: min(232px, 62vw) !important;
    margin-block: 7px 9px !important;
  }
}


/* Face guide visibility v59 */
.capture-instruction-layer {
  background: rgba(9, 12, 12, 0.18) !important;
  backdrop-filter: blur(1.6px) !important;
  -webkit-backdrop-filter: blur(1.6px) !important;
}

.capture-instruction-card {
  background:
    linear-gradient(180deg, rgba(238, 240, 236, 0.78), rgba(229, 232, 226, 0.68)),
    rgba(238, 240, 236, 0.72) !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.52) !important;
}

.face-guide-diagram {
  width: min(282px, 72vw) !important;
  aspect-ratio: 0.82 / 1 !important;
  margin: 6px auto 9px !important;
}

.face-guide-image {
  inset: -8% -7% -7% -7% !important;
  width: 114% !important;
  height: 115% !important;
  opacity: 1 !important;
  filter: invert(1) grayscale(1) contrast(2.45) brightness(0.42) !important;
}

.face-guide-diagram .diagram-eye-line,
.face-guide-diagram .diagram-center-line {
  background: rgba(86, 91, 91, 0.96) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 1px 5px rgba(0, 0, 0, 0.2) !important;
}

.face-guide-diagram .diagram-eye-line {
  left: -1% !important;
  right: -1% !important;
  top: 43.8% !important;
  height: 2.5px !important;
}

.face-guide-diagram .diagram-center-line {
  top: 5% !important;
  bottom: 5% !important;
  width: 2.5px !important;
}

.capture-instruction-copy {
  color: rgba(15, 34, 31, 0.94) !important;
}

.capture-instruction-subcopy {
  color: rgba(28, 42, 40, 0.74) !important;
}

@media (max-width: 430px) {
  .face-guide-diagram {
    width: min(270px, 72vw) !important;
    margin-block: 5px 8px !important;
  }
}


/* Guide spacing and eye line v60 */
.capture-instruction-layer {
  padding-top: calc(60px + env(safe-area-inset-top)) !important;
  padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
}

.capture-instruction-card {
  max-height: calc(100dvh - 168px) !important;
  padding: 13px 16px 18px !important;
  border-radius: 22px !important;
}

.capture-instruction-header .eyebrow {
  margin-bottom: 2px !important;
  font-size: 0.6rem !important;
}

.capture-instruction-header h3 {
  font-size: clamp(1.08rem, 4vw, 1.42rem) !important;
  line-height: 1 !important;
}

.face-guide-diagram {
  width: min(266px, 69vw) !important;
  aspect-ratio: 0.84 / 1 !important;
  margin: 15px auto 5px !important;
}

.face-guide-image {
  inset: -9% -7% -7% -7% !important;
  width: 114% !important;
  height: 115% !important;
}

.face-guide-diagram .diagram-eye-line {
  top: 45.1% !important;
}

.face-guide-diagram .diagram-center-line {
  top: 7% !important;
  bottom: 7% !important;
}

.capture-instruction-copy {
  margin-top: 0 !important;
  max-width: 34ch !important;
  font-size: 0.84rem !important;
  line-height: 1.18 !important;
}

.capture-instruction-subcopy {
  max-width: 38ch !important;
  margin-top: 5px !important;
  font-size: 0.72rem !important;
  line-height: 1.18 !important;
}

.capture-instruction-actions {
  margin-top: 9px !important;
  padding-bottom: 0 !important;
}

.capture-instruction-actions button {
  min-height: 38px !important;
  font-size: 0.72rem !important;
}

@media (max-width: 430px) {
  .capture-instruction-layer {
    padding-top: calc(56px + env(safe-area-inset-top)) !important;
    padding-bottom: calc(102px + env(safe-area-inset-bottom)) !important;
  }

  .capture-instruction-card {
    max-height: calc(100dvh - 158px) !important;
    padding: 12px 14px 17px !important;
  }

  .face-guide-diagram {
    width: min(252px, 67vw) !important;
    margin: 13px auto 4px !important;
  }

  .capture-instruction-subcopy {
    max-width: 36ch !important;
    font-size: 0.7rem !important;
  }
}


/* Editor onboarding and DIMIR polish v61 */
.topbar-reset-hidden {
  display: none !important;
}

body.has-photo .topbar {
  display: grid !important;
  grid-template-columns: auto auto 1fr;
  align-items: start;
  gap: 12px;
  padding-top: calc(18px + env(safe-area-inset-top)) !important;
  pointer-events: none;
}

.editor-brand-lockup,
.editor-guide-button,
.top-edit-switch {
  pointer-events: auto;
}

.editor-brand-lockup {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.42);
}

.editor-brand-name {
  font-size: 0.91rem;
  font-weight: 860;
  letter-spacing: 0.34em;
  line-height: 1;
}

.editor-brand-version {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.58rem;
  font-weight: 820;
  letter-spacing: 0.04em;
  line-height: 1;
}

.editor-guide-button {
  min-width: 0;
  min-height: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  color: rgba(255, 255, 255, 0.94);
  font: inherit;
  font-size: 0.69rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.has-photo.photo-edit-mode .photo-stage::after {
  content: none !important;
  display: none !important;
}

.camera-guide .camera-guide-mouth::before {
  content: "Nose position" !important;
}

.icon-pen::before {
  left: 4px;
  top: 14px;
  width: 15px;
  height: 4px;
  border: 2px solid currentColor;
  border-radius: 3px;
  transform: rotate(-45deg);
  transform-origin: center;
}

.icon-pen::after {
  left: 14px;
  top: 3px;
  width: 6px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 2px;
  transform: rotate(-45deg);
}

.editor-instruction-layer {
  position: fixed;
  inset: 0;
  z-index: 88;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(72px + env(safe-area-inset-top)) 18px calc(112px + env(safe-area-inset-bottom));
  background: rgba(8, 15, 14, 0.18);
  backdrop-filter: blur(1.8px);
  -webkit-backdrop-filter: blur(1.8px);
  pointer-events: auto;
}

.editor-instruction-layer.is-visible {
  display: flex;
}

.editor-instruction-card {
  width: min(430px, calc(100vw - 34px));
  max-height: calc(100dvh - 170px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(252, 254, 251, 0.9), rgba(239, 246, 242, 0.76)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  padding: 16px 16px 18px;
  color: #102321;
}

.editor-guide-visual {
  position: relative;
  width: min(252px, 64vw);
  aspect-ratio: 0.86 / 1;
  margin: 14px auto 10px;
}

.editor-guide-phone {
  position: absolute;
  inset: 4% 13% 3%;
  border: 2px solid rgba(75, 88, 87, 0.36);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 59%, rgba(25, 55, 50, 0.14), transparent 22%),
    rgba(255, 255, 255, 0.2);
}

.editor-guide-centerline {
  position: absolute;
  left: 50%;
  top: 8%;
  bottom: 9%;
  width: 3px;
  border-radius: 99px;
  background: rgba(79, 90, 89, 0.82);
  transform: translateX(-50%);
}

.editor-guide-nose-label {
  position: absolute;
  left: calc(50% + 10px);
  top: 35%;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(20, 45, 41, 0.14);
  color: rgba(16, 35, 33, 0.74);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.editor-guide-mouth-shape {
  position: absolute;
  left: 21%;
  right: 21%;
  top: 57%;
  height: 23%;
  border: 3px solid rgba(40, 118, 110, 0.82);
  border-top-width: 2px;
  border-radius: 12% 12% 50% 50% / 32% 32% 68% 68%;
  background: rgba(89, 176, 169, 0.16);
  box-shadow: 0 0 0 8px rgba(89, 176, 169, 0.07);
}

.editor-guide-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border: 2px solid rgba(40, 118, 110, 0.9);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

.editor-guide-dot.dot-one { left: 20%; top: 58%; }
.editor-guide-dot.dot-two { left: 42%; top: 55%; }
.editor-guide-dot.dot-three { right: 22%; top: 58%; }
.editor-guide-dot.dot-four { left: 48%; top: 76%; }

.editor-guide-pen {
  position: absolute;
  right: 19%;
  top: 45%;
  width: 40px;
  height: 9px;
  border: 2px solid rgba(16, 35, 33, 0.78);
  border-radius: 8px;
  transform: rotate(-42deg);
  transform-origin: center;
  background: rgba(255, 255, 255, 0.46);
}

.editor-guide-pen::after {
  content: "";
  position: absolute;
  right: -8px;
  top: -2px;
  border-left: 8px solid rgba(16, 35, 33, 0.78);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.editor-guide-steps {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.editor-guide-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  align-items: start;
  color: rgba(16, 35, 33, 0.78);
  font-size: 0.86rem;
  font-weight: 720;
  line-height: 1.24;
}

.editor-guide-steps strong {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #173d38;
  color: #ffffff;
  font-size: 0.74rem;
}

.editor-instruction-actions {
  margin-top: 4px;
}

body:not(.has-photo) .landing-brand .landing-mark {
  width: clamp(53px, 13.75vw, 80px) !important;
}

.landing-wordmark {
  font-size: clamp(20px, 6.2vw, 42px) !important;
}

.camera-brand-name {
  font-size: 0.9rem !important;
}

.camera-brand-version {
  font-size: 0.58rem !important;
}

@media (max-width: 760px) {
  .camera-brand-name,
  .editor-brand-name {
    font-size: 0.86rem !important;
  }

  .camera-brand-version,
  .editor-brand-version {
    font-size: 0.56rem !important;
  }
}

@media (max-width: 430px) {
  body.has-photo .topbar {
    gap: 8px;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .editor-brand-lockup {
    gap: 8px;
  }

  .editor-guide-button {
    padding: 7px 9px;
    font-size: 0.65rem;
  }

  body:not(.has-photo) .landing-brand .landing-mark {
    width: clamp(50px, 15vw, 68px) !important;
  }

  .landing-wordmark {
    font-size: clamp(20px, 6.4vw, 29px) !important;
    letter-spacing: 0.12em !important;
  }

  .editor-instruction-layer {
    padding-top: calc(64px + env(safe-area-inset-top));
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .editor-instruction-card {
    max-height: calc(100dvh - 150px);
    padding: 14px 14px 16px;
  }

  .editor-guide-visual {
    width: min(228px, 62vw);
    margin-top: 12px;
  }

  .editor-guide-steps li {
    font-size: 0.8rem;
    line-height: 1.2;
  }
}


/* Editor mouth guide image and controls v62 */
body.has-photo .topbar {
  grid-template-columns: auto 1fr auto !important;
  z-index: 80 !important;
}

body.has-photo .editor-guide-button {
  position: fixed !important;
  top: calc(18px + env(safe-area-inset-top)) !important;
  right: 18px !important;
  z-index: 120 !important;
}

body.has-photo .editor-brand-lockup {
  position: fixed !important;
  top: calc(20px + env(safe-area-inset-top)) !important;
  left: 18px !important;
  z-index: 112 !important;
}

body.has-photo .top-edit-switch {
  justify-self: center !important;
  z-index: 82 !important;
}

.template-library-tab {
  z-index: 52 !important;
}

body.has-photo .floating-tools,
body.has-photo .bottom-toolbar {
  z-index: 74 !important;
}

body.has-photo #takeGuidedPhoto,
body.has-photo #flipPhoto {
  display: inline-flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.has-photo #takeGuidedPhoto .tool-label {
  font-size: 0;
}

body.has-photo #takeGuidedPhoto .tool-label::after {
  content: "Camera";
  font-size: 10px;
}

.mouth-guide-visual {
  width: min(292px, 74vw) !important;
  aspect-ratio: 1 / 1.08 !important;
  margin: 10px auto 9px !important;
  overflow: visible;
}

.mouth-guide-image {
  position: absolute;
  inset: -10% -13% -12%;
  width: 126%;
  height: 125%;
  object-fit: contain;
  opacity: 1;
  filter: invert(1) grayscale(1) contrast(2.35) brightness(0.46);
}

.mouth-guide-visual .editor-guide-centerline {
  top: 7%;
  bottom: 10%;
  width: 3px;
  background: rgba(72, 84, 83, 0.86);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18);
}

.mouth-guide-visual .editor-guide-nose-label {
  top: 20%;
  left: calc(50% + 11px);
  background: rgba(20, 45, 41, 0.22);
}

.mouth-guide-visual .editor-guide-mouth-shape {
  left: 13%;
  right: 13%;
  top: 47%;
  height: 24%;
  border-color: rgba(49, 132, 124, 0.96);
  background: rgba(97, 190, 181, 0.18);
  border-radius: 18% 18% 46% 46% / 36% 36% 70% 70%;
  box-shadow: 0 0 0 9px rgba(97, 190, 181, 0.08), inset 0 0 18px rgba(255,255,255,0.16);
}

.mouth-guide-visual .editor-guide-dot {
  width: 7px;
  height: 7px;
  z-index: 4;
  border-color: rgba(18, 96, 89, 0.96);
}

.mouth-guide-visual .dot-one { left: 14%; top: 52%; }
.mouth-guide-visual .dot-two { left: 31%; top: 47%; }
.mouth-guide-visual .dot-three { left: 49%; top: 50%; }
.mouth-guide-visual .dot-four { right: 31%; top: 47%; }
.mouth-guide-visual .dot-five { right: 14%; top: 52%; }
.mouth-guide-visual .dot-six { left: 49%; top: 68%; }

.mouth-guide-visual .editor-guide-pen {
  right: 12%;
  top: 39%;
  z-index: 5;
}

@media (max-width: 430px) {
  body.has-photo .editor-guide-button {
    top: calc(17px + env(safe-area-inset-top)) !important;
    right: 14px !important;
  }

  body.has-photo .editor-brand-lockup {
    top: calc(19px + env(safe-area-inset-top)) !important;
    left: 14px !important;
  }

  .mouth-guide-visual {
    width: min(262px, 72vw) !important;
    margin-top: 8px !important;
  }
}


/* Single-image editor guide v63 */
.mouth-guide-single-image {
  width: min(232px, 58vw) !important;
  height: min(224px, 30dvh) !important;
  aspect-ratio: auto !important;
  margin: 7px auto 7px !important;
  overflow: hidden !important;
}

.mouth-guide-single-image .mouth-guide-image {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  opacity: 1 !important;
  filter: invert(1) grayscale(1) contrast(2.1) brightness(0.48) !important;
}

.mouth-guide-single-image .editor-guide-centerline,
.mouth-guide-single-image .editor-guide-nose-label,
.mouth-guide-single-image .editor-guide-mouth-shape,
.mouth-guide-single-image .editor-guide-pen,
.mouth-guide-single-image .editor-guide-dot {
  display: none !important;
}

.editor-instruction-card {
  padding-top: 13px !important;
  padding-bottom: 14px !important;
}

.editor-guide-steps {
  gap: 6px !important;
  margin-bottom: 10px !important;
}

.editor-guide-steps li {
  font-size: 0.8rem !important;
  line-height: 1.18 !important;
}

.editor-guide-steps strong {
  width: 22px !important;
  height: 22px !important;
}

.editor-instruction-actions {
  margin-top: 2px !important;
}

@media (max-width: 430px) {
  .mouth-guide-single-image {
    width: min(210px, 56vw) !important;
    height: min(202px, 27dvh) !important;
    margin: 6px auto 6px !important;
  }

  .editor-instruction-card {
    max-height: calc(100dvh - 154px) !important;
    padding: 12px 13px 13px !important;
  }

  .editor-guide-steps li {
    grid-template-columns: 25px 1fr !important;
    gap: 7px !important;
    font-size: 0.76rem !important;
    line-height: 1.15 !important;
  }

  .editor-instruction-actions button {
    min-height: 36px !important;
    font-size: 0.68rem !important;
  }
}


/* Unified editor workflow v64 */
body.has-photo .topbar {
  height: 108px !important;
  display: grid !important;
  grid-template-columns: 42px 1fr auto !important;
  align-items: start !important;
  padding: calc(16px + env(safe-area-inset-top)) 16px 0 !important;
  background: linear-gradient(180deg, rgba(6, 11, 10, 0.36), rgba(6, 11, 10, 0)) !important;
  z-index: 114 !important;
}

.icon-home::before {
  left: 4px;
  top: 9px;
  width: 14px;
  height: 12px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 2px;
}

.icon-home::after {
  left: 3px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.icon-reset::before {
  left: 3px;
  top: 5px;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}

.icon-reset::after {
  right: 2px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(12deg);
}

.brand-home-button {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

body.has-photo .editor-brand-lockup {
  position: fixed !important;
  top: calc(25px + env(safe-area-inset-top)) !important;
  left: 16px !important;
  z-index: 123 !important;
}

body.has-photo .editor-guide-button {
  top: calc(18px + env(safe-area-inset-top)) !important;
  right: 14px !important;
  z-index: 126 !important;
}

body.has-photo .top-edit-switch {
  position: fixed !important;
  top: calc(64px + env(safe-area-inset-top)) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  display: grid !important;
  grid-template-columns: repeat(2, 42px) !important;
  gap: 6px !important;
  padding: 5px !important;
  border-radius: 999px !important;
  background: rgba(9, 18, 17, 0.34) !important;
  border: 1px solid rgba(255, 255, 255, 0.26) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  z-index: 122 !important;
}

body.has-photo .top-edit-switch .mode-toggle {
  width: 42px !important;
  height: 38px !important;
  border-radius: 999px !important;
}

body.has-photo .floating-tools {
  position: fixed !important;
  right: 12px !important;
  left: auto !important;
  bottom: max(82px, calc(70px + env(safe-area-inset-bottom))) !important;
  z-index: 118 !important;
  width: min(390px, calc(100vw - 24px)) !important;
  pointer-events: none;
}

body.has-photo .bottom-toolbar {
  pointer-events: auto;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 7px !important;
  position: static !important;
  width: 100% !important;
  padding: 8px !important;
  border-radius: 24px !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  background: rgba(20, 16, 15, 0.34) !important;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28) !important;
  backdrop-filter: blur(18px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.2) !important;
}

body.has-photo .bottom-toolbar #takeGuidedPhoto,
body.has-photo .bottom-toolbar #openCamera,
body.has-photo .bottom-toolbar #centerGuide,
body.has-photo .bottom-toolbar #flipPhoto {
  display: none !important;
}

body.has-photo .bottom-toolbar #quickReset,
body.has-photo .bottom-toolbar .file-button,
body.has-photo .bottom-toolbar #toggleBefore,
body.has-photo .bottom-toolbar #downloadImage {
  display: inline-flex !important;
}

body.has-photo .bottom-toolbar .tool-button {
  min-width: 0 !important;
  min-height: 48px !important;
  padding: 5px 4px !important;
  border-radius: 18px !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.92) !important;
}

body.has-photo .bottom-toolbar .primary-tool {
  background: rgba(190, 92, 74, 0.68) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

body.has-photo #downloadImage .tool-label {
  font-size: 0 !important;
}

body.has-photo #downloadImage .tool-label::after {
  content: "Confirm";
  font-size: 10px;
}

.editor-guide-pages {
  position: relative;
}

.editor-guide-page {
  display: none;
}

.editor-guide-page.is-active {
  display: block;
}

.editor-guide-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: -2px 0 8px;
}

.editor-guide-dots button {
  width: 7px;
  height: 7px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 35, 33, 0.24);
}

.editor-guide-dots button.is-active {
  width: 19px;
  background: #173d38;
}

.editor-guide-library-card {
  position: relative;
  width: min(220px, 56vw);
  height: min(210px, 28dvh);
  margin: 9px auto 8px;
  border: 1px solid rgba(23, 61, 56, 0.16);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.66), rgba(230,241,237,0.5));
  overflow: hidden;
}

.library-card-handle {
  position: absolute;
  left: 50%;
  top: 11px;
  width: 44px;
  height: 4px;
  border-radius: 99px;
  background: rgba(23, 61, 56, 0.28);
  transform: translateX(-50%);
}

.library-card-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 27px;
  text-align: center;
  color: rgba(16,35,33,0.78);
  font-size: 0.72rem;
  font-weight: 840;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-card-arch {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 48px;
  height: 76px;
  border: 3px solid rgba(45, 122, 114, 0.7);
  border-top: 0;
  border-radius: 0 0 90px 90px;
}

.library-card-tooth {
  position: absolute;
  bottom: 72px;
  width: 34px;
  height: 48px;
  border: 2px solid rgba(45, 122, 114, 0.58);
  border-radius: 14px 14px 20px 20px;
  background: rgba(255,255,255,0.46);
}

.library-card-tooth.t1 { left: 65px; }
.library-card-tooth.t2 { left: 94px; height: 54px; }
.library-card-tooth.t3 { right: 65px; }

@media (max-width: 430px) {
  body.has-photo .floating-tools {
    right: 10px !important;
    width: min(360px, calc(100vw - 20px)) !important;
    bottom: max(78px, calc(66px + env(safe-area-inset-bottom))) !important;
  }

  body.has-photo .bottom-toolbar {
    gap: 6px !important;
    padding: 7px !important;
  }

  body.has-photo .bottom-toolbar .tool-button {
    min-height: 46px !important;
  }

  body.has-photo .editor-brand-lockup {
    left: 14px !important;
  }
}


/* Landing toolbar cleanup v65 */
body:not(.has-photo) .floating-tools {
  display: none !important;
}


/* Editor polish without URL version bump */
body.has-photo .photo-stage::before {
  content: attr(data-confirm-message);
}

body.has-photo .floating-tools {
  left: 50% !important;
  right: auto !important;
  bottom: max(22px, calc(16px + env(safe-area-inset-bottom))) !important;
  width: min(356px, calc(100vw - 28px)) !important;
  transform: translateX(-50%) !important;
  z-index: 118 !important;
}

body.has-photo .bottom-toolbar {
  height: 66px !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 8px !important;
  padding: 7px !important;
  border-radius: 25px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)),
    rgba(13, 18, 18, 0.44) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
  backdrop-filter: blur(20px) saturate(1.18) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.18) !important;
}

body.has-photo .bottom-toolbar .tool-button {
  display: inline-grid !important;
  grid-template-rows: 23px 14px !important;
  align-content: center !important;
  justify-items: center !important;
  gap: 4px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 52px !important;
  padding: 6px 3px 5px !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  line-height: 1 !important;
}

body.has-photo .bottom-toolbar .tool-button.is-active,
body.has-photo .bottom-toolbar .tool-button:active {
  background: rgba(255, 255, 255, 0.22) !important;
  transform: translateY(1px);
}

body.has-photo .bottom-toolbar .primary-tool {
  background: linear-gradient(180deg, rgba(209, 116, 96, 0.92), rgba(164, 74, 62, 0.88)) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

body.has-photo .bottom-toolbar .line-icon {
  width: 22px !important;
  height: 22px !important;
  margin: 0 !important;
}

body.has-photo .bottom-toolbar .tool-label,
body.has-photo #downloadImage .tool-label::after {
  display: block !important;
  font-size: 10px !important;
  font-weight: 780 !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
}

body.has-photo #downloadImage .tool-label {
  font-size: 0 !important;
}

body.has-photo .top-edit-switch {
  top: calc(62px + env(safe-area-inset-top)) !important;
  z-index: 54 !important;
  grid-template-columns: repeat(2, 40px) !important;
  gap: 6px !important;
  padding: 5px !important;
  background: rgba(10, 18, 18, 0.31) !important;
}

body.has-photo .top-edit-switch .mode-toggle {
  width: 40px !important;
  height: 38px !important;
  color: rgba(255, 255, 255, 0.92) !important;
}

.icon-image::before {
  left: 3px !important;
  top: 4px !important;
  width: 16px !important;
  height: 16px !important;
  border: 2px solid currentColor !important;
  border-radius: 50% 50% 46% 46% !important;
  background: transparent !important;
}

.icon-image::after {
  left: 7px !important;
  top: 15px !important;
  width: 8px !important;
  height: 5px !important;
  border: 2px solid currentColor !important;
  border-top: 0 !important;
  border-radius: 0 0 10px 10px !important;
  background: transparent !important;
  box-shadow: 0 -8px 0 -3px currentColor !important;
}

.icon-pen::before {
  left: 4px !important;
  top: 14px !important;
  width: 16px !important;
  height: 3px !important;
  border: 2px solid currentColor !important;
  border-radius: 999px !important;
  transform: rotate(-43deg) !important;
}

.icon-pen::after {
  left: 15px !important;
  top: 3px !important;
  width: 5px !important;
  height: 8px !important;
  border: 2px solid currentColor !important;
  border-radius: 2px !important;
  transform: rotate(-43deg) !important;
}

.template-library {
  z-index: 92 !important;
  padding-top: calc(92px + env(safe-area-inset-top)) !important;
  transform: translateY(calc(-100% + 52px + env(safe-area-inset-top))) !important;
}

.template-library.is-open {
  transform: translateY(0) !important;
}

.template-library-panel {
  width: min(690px, calc(100vw - 22px)) !important;
  max-height: min(48dvh, 430px) !important;
  margin-top: 0 !important;
  padding: 14px 14px 16px !important;
  border-radius: 0 0 26px 26px !important;
}

.template-library-header {
  margin-bottom: 12px !important;
}

.template-library-header h3 {
  font-size: 15px !important;
}

.template-apply-button {
  min-height: 36px !important;
  padding: 0 16px !important;
}

.template-library-tab {
  width: 104px !important;
  min-height: 46px !important;
  grid-template-rows: 3px 12px 8px !important;
  gap: 5px !important;
  border-radius: 0 0 20px 20px !important;
  color: rgba(23, 61, 56, 0.88) !important;
  z-index: 94 !important;
}

.template-tab-label {
  display: block;
  font-size: 0.58rem;
  font-weight: 860;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

body.template-library-open .top-edit-switch {
  z-index: 42 !important;
  opacity: 0.38 !important;
}

body.template-library-open .editor-guide-button,
body.template-library-open .editor-brand-lockup {
  z-index: 96 !important;
}

body.mouth-cutout-active::after {
  min-width: 218px !important;
  padding: 11px 16px !important;
  border-radius: 999px !important;
  background: rgba(12, 25, 24, 0.78) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24) !important;
  color: #ffffff !important;
  font-size: 0.78rem !important;
  font-weight: 820 !important;
  text-align: center !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

body.teeth-preview-visible .photo-stage {
  box-shadow: inset 0 0 0 2px rgba(112, 210, 196, 0.38);
}

@media (max-width: 430px) {
  body.has-photo .floating-tools {
    bottom: max(18px, calc(12px + env(safe-area-inset-bottom))) !important;
    width: min(350px, calc(100vw - 22px)) !important;
  }

  body.has-photo .bottom-toolbar {
    height: 64px !important;
    gap: 7px !important;
    padding: 7px !important;
  }

  body.has-photo .bottom-toolbar .tool-button {
    height: 50px !important;
  }

  .template-library {
    padding-top: calc(96px + env(safe-area-inset-top)) !important;
  }

  .template-library-panel {
    max-height: min(52dvh, 448px) !important;
  }
}

/* DIMIR brand version alignment */
.editor-brand-lockup,
.camera-brand-lockup {
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 1px !important;
  width: max-content !important;
  min-width: 0 !important;
  height: auto !important;
  padding: 0 !important;
  text-align: left !important;
}

.editor-brand-name,
.camera-brand-name {
  display: block !important;
  width: max-content !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.editor-brand-version,
.camera-brand-version {
  display: block !important;
  align-self: flex-end !important;
  margin: 2px 0 0 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  text-align: right !important;
  white-space: nowrap !important;
}

@media (max-width: 430px) {
  .editor-brand-lockup,
  .camera-brand-lockup {
    gap: 0 !important;
  }

  .editor-brand-version,
  .camera-brand-version {
    margin-top: 1px !important;
  }
}

/* DIMIR brand version slight inset */
.editor-brand-version,
.camera-brand-version {
  margin-right: 7px !important;
}

@media (max-width: 430px) {
  .editor-brand-version,
  .camera-brand-version {
    margin-right: 6px !important;
  }
}

/* DIMIR library layer polish */
.template-library {
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 12000 !important;
  padding-top: 0 !important;
  transform: translateY(calc(-100% + 46px)) !important;
  transition:
    transform 560ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 260ms ease !important;
  will-change: transform !important;
}

.template-library.is-open {
  transform: translateY(0) !important;
}

.template-library-panel {
  width: 100% !important;
  max-width: none !important;
  max-height: min(55dvh, 470px) !important;
  margin: 0 !important;
  padding: calc(78px + env(safe-area-inset-top)) max(14px, calc((100vw - 720px) / 2 + 14px)) 16px !important;
  border-top: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-radius: 0 0 28px 28px !important;
  background:
    linear-gradient(180deg, rgba(250, 254, 252, 0.96), rgba(236, 249, 246, 0.9)),
    rgba(255, 255, 255, 0.88) !important;
  box-shadow: 0 28px 76px rgba(7, 22, 20, 0.32) !important;
  backdrop-filter: blur(26px) saturate(1.18) !important;
  -webkit-backdrop-filter: blur(26px) saturate(1.18) !important;
}

.template-library-header {
  margin-bottom: 12px !important;
}

.template-library-header .eyebrow {
  color: rgba(31, 101, 94, 0.86) !important;
  font-size: 10px !important;
  letter-spacing: 0.18em !important;
}

.template-apply-button {
  position: relative !important;
  z-index: 2 !important;
}

.template-library-tab {
  position: relative !important;
  z-index: 12001 !important;
  margin-top: 0 !important;
  transition:
    transform 520ms cubic-bezier(0.16, 1, 0.3, 1),
    background 220ms ease,
    box-shadow 220ms ease !important;
}

body.template-library-open .editor-brand-lockup,
body.template-library-open .editor-guide-button,
body.template-library-open .top-edit-switch {
  z-index: 40 !important;
  opacity: 0.18 !important;
  pointer-events: none !important;
  filter: blur(0.5px) !important;
}

body.has-photo.mouth-edit-mode.mouth-layer-ready:not(.mouth-layer-confirmed) .photo-stage::after,
body.has-photo.mouth-edit-mode.mouth-layer-confirmed .photo-stage::after,
body.has-photo.mouth-edit-mode.mouth-cutout-active .photo-stage::after,
body.has-photo.teeth-edit-mode.mouth-cutout-active .photo-stage::after,
body.mouth-cutout-active::after {
  content: none !important;
  display: none !important;
}

@media (max-width: 760px) {
  .template-library-panel {
    max-height: min(58dvh, 500px) !important;
    padding: calc(82px + env(safe-area-inset-top)) 12px 15px !important;
  }
}

@media (max-width: 430px) {
  .template-library {
    transform: translateY(calc(-100% + 48px)) !important;
  }

  .template-library.is-open {
    transform: translateY(0) !important;
  }

  .template-library-panel {
    max-height: min(60dvh, 510px) !important;
    padding: calc(86px + env(safe-area-inset-top)) 11px 14px !important;
    border-radius: 0 0 24px 24px !important;
  }
}

/* DIMIR precision editor fixes */
.camera-guide .camera-guide-mouth::before {
  content: "Eye position" !important;
}

body.has-photo .photo-stage::after {
  content: none !important;
  display: none !important;
}

body.teeth-preview-visible .photo-stage {
  box-shadow: none !important;
}

.editor-instruction-layer {
  z-index: 13050 !important;
  align-items: flex-start !important;
  padding: calc(112px + env(safe-area-inset-top)) 14px calc(84px + env(safe-area-inset-bottom)) !important;
}

.editor-instruction-card {
  max-height: calc(100dvh - 140px - env(safe-area-inset-bottom)) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

@media (max-width: 430px) {
  .editor-instruction-layer {
    padding-top: calc(118px + env(safe-area-inset-top)) !important;
    padding-bottom: calc(74px + env(safe-area-inset-bottom)) !important;
  }

  .editor-instruction-card {
    max-height: calc(100dvh - 146px - env(safe-area-inset-bottom)) !important;
  }
}

/* DIMIR editor guide library image */
.library-guide-single-image {
  width: min(232px, 58vw) !important;
  height: min(224px, 30dvh) !important;
  aspect-ratio: auto !important;
  margin: 7px auto 7px !important;
  overflow: hidden !important;
  border-radius: 18px !important;
  background: rgba(239, 250, 247, 0.42) !important;
}

.library-guide-single-image .library-guide-image {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center 18% !important;
  opacity: 1 !important;
  filter: none !important;
}

@media (max-width: 430px) {
  .library-guide-single-image {
    width: min(210px, 56vw) !important;
    height: min(202px, 27dvh) !important;
    margin: 6px auto 6px !important;
    border-radius: 16px !important;
  }
}

/* DIMIR SVG icon system */
.svg-icon {
  color: currentColor;
}

.svg-icon::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: currentColor !important;
  box-shadow: none !important;
  transform: none !important;
  -webkit-mask: var(--icon-url) center / contain no-repeat !important;
  mask: var(--icon-url) center / contain no-repeat !important;
}

.svg-icon::after {
  content: none !important;
  display: none !important;
}

.icon-home { --icon-url: url("assets/Icons/home.svg"); }
.icon-switch-camera { --icon-url: url("assets/Icons/switch-camera.svg"); }
.icon-portrait { --icon-url: url("assets/Icons/portrait.svg"); }
.icon-finger { --icon-url: url("assets/Icons/cursor-finger.svg"); }
.icon-undo { --icon-url: url("assets/Icons/undo.svg"); }
.icon-trash { --icon-url: url("assets/Icons/trash.svg"); }
.icon-restart { --icon-url: url("assets/Icons/restart.svg"); }
.icon-picture { --icon-url: url("assets/Icons/picture.svg"); }
.icon-before-svg { --icon-url: url("assets/Icons/before.svg"); }
.icon-confirm { --icon-url: url("assets/Icons/confirm.svg"); }
.icon-edit { --icon-url: url("assets/Icons/edit.svg"); }
.icon-picture-save { --icon-url: url("assets/Icons/picture.svg"); }
.icon-exit { --icon-url: url("assets/Icons/exit.svg"); }
.icon-rock { --icon-url: url("assets/Icons/rock.svg"); }

.camera-back-button::before,
.camera-switch-button::before {
  background: rgba(255, 255, 255, 0.94) !important;
  -webkit-mask: var(--camera-icon-url) center / contain no-repeat !important;
  mask: var(--camera-icon-url) center / contain no-repeat !important;
}

.camera-back-button::before {
  --camera-icon-url: url("assets/Icons/home.svg");
  width: 31px !important;
  height: 31px !important;
}

.camera-switch-button::before {
  --camera-icon-url: url("assets/Icons/switch-camera.svg");
  width: 33px !important;
  height: 33px !important;
}

body.has-photo .top-edit-switch {
  background: rgba(6, 20, 19, 0.46) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18) !important;
  backdrop-filter: blur(16px) saturate(1.15) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.15) !important;
}

body.has-photo .top-edit-switch .mode-toggle {
  color: rgba(232, 246, 242, 0.88) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

body.has-photo .top-edit-switch .mode-toggle.is-active {
  color: #123f39 !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(221, 247, 242, 0.94)) !important;
  border-color: rgba(141, 224, 212, 0.78) !important;
  box-shadow: 0 8px 20px rgba(21, 89, 81, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.72) !important;
}

body.has-photo .top-edit-switch .mode-toggle .line-icon {
  width: 23px !important;
  height: 23px !important;
  opacity: 1 !important;
}

.mouth-layer-action {
  position: absolute;
  z-index: 11;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(17, 32, 30, 0.62);
  color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease;
}

.mouth-layer-action .line-icon {
  width: 22px;
  height: 22px;
}

.mouth-layer-action.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.mouth-layer-trash {
  background: rgba(118, 22, 18, 0.72);
  color: #fff4ef;
  border-color: rgba(255, 190, 178, 0.5);
}

body.has-photo .floating-tools {
  width: min(430px, calc(100vw - 18px)) !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar {
  height: 66px !important;
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 6px !important;
  padding: 7px !important;
  border-radius: 24px !important;
  background: rgba(17, 26, 25, 0.58) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28) !important;
  backdrop-filter: blur(18px) saturate(1.15) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.15) !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar .tool-button {
  height: 52px !important;
  min-height: 52px !important;
  display: grid !important;
  grid-template-rows: 31px 12px !important;
  align-items: center !important;
  justify-items: center !important;
  gap: 1px !important;
  padding: 4px 2px !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.09) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: rgba(250, 255, 253, 0.92) !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar .tool-button:active,
body.has-photo .bottom-toolbar.dimir-action-toolbar .tool-button.is-active {
  color: #143f3a !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(225, 247, 243, 0.9)) !important;
  border-color: rgba(127, 222, 209, 0.66) !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar .primary-tool {
  background: linear-gradient(180deg, rgba(206, 107, 91, 0.95), rgba(164, 70, 60, 0.9)) !important;
  border-color: rgba(255, 219, 210, 0.34) !important;
  color: #fffaf6 !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar .primary-tool:active,
body.has-photo .bottom-toolbar.dimir-action-toolbar .primary-tool.is-active {
  color: #fffaf6 !important;
  background: linear-gradient(180deg, rgba(222, 124, 105, 0.98), rgba(174, 76, 63, 0.94)) !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar .line-icon {
  width: 30px !important;
  height: 30px !important;
  margin: 0 !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar .tool-label,
body.has-photo #downloadImage .tool-label {
  display: block !important;
  font-size: 10px !important;
  font-weight: 780 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
}

.action-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 15000;
  min-width: 150px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(12, 28, 26, 0.78);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 820;
  text-align: center;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease;
}

.action-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 430px) {
  body.has-photo .floating-tools {
    width: min(398px, calc(100vw - 14px)) !important;
  }

  body.has-photo .bottom-toolbar.dimir-action-toolbar {
    gap: 5px !important;
    padding: 6px !important;
  }

  body.has-photo .bottom-toolbar.dimir-action-toolbar .line-icon {
    width: 28px !important;
    height: 28px !important;
  }
}

/* DIMIR final alignment, share, guide, and privacy polish */
.icon-share { --icon-url: url("assets/Icons/share.svg"); }

body.has-photo #downloadImage .tool-label::after,
body.has-photo #takeGuidedPhoto .tool-label::after {
  content: none !important;
  display: none !important;
}

body.has-photo #downloadImage .tool-label {
  font-size: 10px !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar {
  align-items: stretch !important;
  height: 68px !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar .tool-button {
  display: grid !important;
  grid-template-rows: 32px 13px !important;
  place-items: center !important;
  align-content: center !important;
  justify-content: center !important;
  gap: 2px !important;
  line-height: 1 !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar .line-icon {
  width: 30px !important;
  height: 30px !important;
  align-self: end !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar .tool-label {
  height: 13px !important;
  align-self: start !important;
  display: block !important;
  font-size: 10px !important;
  line-height: 13px !important;
  white-space: nowrap !important;
}

.library-guide-single-image {
  width: min(292px, 76vw) !important;
  height: min(206px, 28dvh) !important;
  background: transparent !important;
  border-radius: 22px !important;
}

.library-guide-single-image .library-guide-image {
  object-fit: contain !important;
  object-position: center center !important;
}

.landing-privacy-link {
  display: inline-block;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.34);
}

.landing-privacy-link:active {
  color: #ffffff;
}

.privacy-page {
  min-height: 100dvh;
  margin: 0;
  background: radial-gradient(circle at 78% 14%, rgba(118, 226, 214, 0.16), transparent 32%), #0b0f0e;
  color: #f8fbfa;
}

.privacy-shell {
  width: min(760px, calc(100vw - 32px));
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 0 46px;
}

.privacy-back {
  display: inline-block;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.74);
  font-weight: 860;
  letter-spacing: 0.45em;
  text-decoration: none;
}

.privacy-card {
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
}

.privacy-card h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.privacy-card h2 {
  margin: 28px 0 8px;
  font-size: 1rem;
  color: #a9e7df;
}

.privacy-card p {
  margin: 0 0 12px;
  color: rgba(248, 251, 250, 0.78);
  line-height: 1.6;
}

@media (max-width: 430px) {
  .library-guide-single-image {
    width: min(270px, 78vw) !important;
    height: min(190px, 26dvh) !important;
  }

  body.has-photo .bottom-toolbar.dimir-action-toolbar .line-icon {
    width: 27px !important;
    height: 27px !important;
  }

  body.has-photo .bottom-toolbar.dimir-action-toolbar .tool-label {
    font-size: 9.6px !important;
  }

  .privacy-card {
    padding: 22px;
  }
}

/* DIMIR privacy close and exact toolbar alignment */
.privacy-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 24px;
}

.privacy-topline .privacy-back {
  margin: 0 !important;
}

.privacy-close,
.privacy-bottom-close {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.78rem;
  font-weight: 820;
  text-decoration: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.privacy-bottom-close {
  margin-top: 20px;
  width: max-content;
  background: rgba(169, 231, 223, 0.16);
  color: #eafffc;
}

.icon-restart { --icon-url: url("assets/Icons/restart.svg"); }

body.has-photo .floating-tools {
  width: min(438px, calc(100vw - 12px)) !important;
  bottom: max(16px, calc(10px + env(safe-area-inset-bottom))) !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  height: 70px !important;
  gap: 6px !important;
  padding: 7px !important;
  border-radius: 24px !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar #quickReset,
body.has-photo .bottom-toolbar.dimir-action-toolbar .file-button,
body.has-photo .bottom-toolbar.dimir-action-toolbar #toggleBefore,
body.has-photo .bottom-toolbar.dimir-action-toolbar #downloadImage,
body.has-photo .bottom-toolbar.dimir-action-toolbar #saveImage,
body.has-photo .bottom-toolbar.dimir-action-toolbar #exitEditor {
  display: grid !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar #takeGuidedPhoto,
body.has-photo .bottom-toolbar.dimir-action-toolbar #openCamera,
body.has-photo .bottom-toolbar.dimir-action-toolbar #centerGuide,
body.has-photo .bottom-toolbar.dimir-action-toolbar #flipPhoto {
  display: none !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar .tool-button {
  width: 100% !important;
  height: 56px !important;
  min-width: 0 !important;
  min-height: 56px !important;
  max-height: 56px !important;
  display: grid !important;
  grid-template-rows: 33px 13px !important;
  grid-template-columns: 1fr !important;
  align-items: center !important;
  justify-items: center !important;
  align-content: center !important;
  justify-content: center !important;
  gap: 2px !important;
  padding: 5px 2px 4px !important;
  line-height: 1 !important;
  text-align: center !important;
  overflow: hidden !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar .line-icon,
body.has-photo .bottom-toolbar.dimir-action-toolbar .svg-icon {
  width: 29px !important;
  height: 29px !important;
  min-width: 29px !important;
  min-height: 29px !important;
  max-width: 29px !important;
  max-height: 29px !important;
  margin: 0 !important;
  align-self: center !important;
  justify-self: center !important;
  flex: 0 0 auto !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar .tool-label,
body.has-photo .bottom-toolbar.dimir-action-toolbar #downloadImage .tool-label,
body.has-photo .bottom-toolbar.dimir-action-toolbar .tool-label::after,
body.has-photo .bottom-toolbar.dimir-action-toolbar #downloadImage .tool-label::after {
  content: none !important;
  display: block !important;
  width: 100% !important;
  height: 13px !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 9.8px !important;
  font-weight: 780 !important;
  letter-spacing: 0 !important;
  line-height: 13px !important;
  text-align: center !important;
  white-space: nowrap !important;
  align-self: center !important;
  justify-self: center !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar #downloadImage .tool-label {
  font-size: 9.8px !important;
}

body.has-photo .bottom-toolbar.dimir-action-toolbar .tool-button:active {
  transform: translateY(1px) !important;
}

@media (max-width: 430px) {
  body.has-photo .floating-tools {
    width: min(404px, calc(100vw - 10px)) !important;
  }

  body.has-photo .bottom-toolbar.dimir-action-toolbar {
    gap: 5px !important;
    padding: 6px !important;
  }

  body.has-photo .bottom-toolbar.dimir-action-toolbar .tool-button {
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    border-radius: 17px !important;
  }

  body.has-photo .bottom-toolbar.dimir-action-toolbar .line-icon,
  body.has-photo .bottom-toolbar.dimir-action-toolbar .svg-icon {
    width: 27px !important;
    height: 27px !important;
    min-width: 27px !important;
    min-height: 27px !important;
  }

  body.has-photo .bottom-toolbar.dimir-action-toolbar .tool-label,
  body.has-photo .bottom-toolbar.dimir-action-toolbar #downloadImage .tool-label {
    font-size: 9.2px !important;
  }
}



/* DIMIR tooth shade vertical control */
.tooth-shade-control {
  position: absolute;
  right: max(10px, env(safe-area-inset-right));
  top: 50%;
  z-index: 86;
  display: none;
  grid-template-rows: auto 150px auto;
  align-items: center;
  justify-items: center;
  gap: 8px;
  width: 46px;
  padding: 11px 7px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(20, 34, 31, 0.24));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(16px) saturate(1.1);
  transform: translateY(-50%);
  pointer-events: auto;
}

body.teeth-preview-visible .tooth-shade-control {
  display: grid;
}

.tooth-shade-control[aria-hidden="true"] {
  display: none !important;
}

.tooth-shade-label {
  display: block;
  color: rgba(255, 255, 255, 0.92);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

#toothShadeSlider {
  width: 150px;
  height: 28px;
  margin: 0;
  transform: rotate(-90deg);
  transform-origin: center;
  accent-color: #f8ffff;
  cursor: pointer;
  touch-action: none;
}

#toothShadeSlider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #efd8b8 0%, #fff9ef 55%, #ffffff 100%);
  box-shadow: inset 0 0 0 1px rgba(20, 50, 46, 0.14);
}

#toothShadeSlider::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  background: radial-gradient(circle at 32% 28%, #ffffff, #f5eee2 72%);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.25);
  -webkit-appearance: none;
  appearance: none;
}

#toothShadeSlider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #efd8b8 0%, #fff9ef 55%, #ffffff 100%);
}

#toothShadeSlider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  background: #fffaf0;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.25);
}

@media (max-width: 430px) {
  .tooth-shade-control {
    right: 8px;
    grid-template-rows: auto 128px auto;
    width: 40px;
    padding: 9px 5px;
  }

  #toothShadeSlider {
    width: 128px;
  }
}


/* DIMIR v67 precision fixes */
body.privacy-page {
  height: auto !important;
  min-height: 100dvh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

.privacy-page .privacy-shell {
  min-height: 100dvh !important;
  overflow: visible !important;
}

.tooth-shade-control {
  z-index: 132 !important;
  right: max(14px, env(safe-area-inset-right)) !important;
  top: 52% !important;
}

body.teeth-preview-visible .tooth-shade-control[aria-hidden="false"] {
  display: grid !important;
}

@media (max-width: 430px) {
  .tooth-shade-control {
    right: 10px !important;
    top: 53% !important;
  }
}


/* DIMIR v68 locked preview, shade rail, and updated guide imagery */
.locked-edit-button {
  position: absolute;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 91;
  display: none;
  grid-template-columns: 24px auto;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 15px 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(22, 37, 34, 0.54);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(18px) saturate(1.15);
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.01em;
}

.locked-edit-button .line-icon {
  width: 24px;
  height: 24px;
}

.locked-edit-button.is-visible {
  display: grid;
}

body:not(.preview-locked) .locked-edit-button,
.locked-edit-button[hidden] {
  display: none !important;
}

.tooth-shade-control {
  grid-template-columns: 1fr;
}

.tooth-shade-control::before {
  content: "";
  grid-row: 2;
  grid-column: 1;
  width: 9px;
  height: 150px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #fff9ef 52%, #efd8b8 100%);
  box-shadow: inset 0 0 0 1px rgba(25, 64, 58, 0.18), 0 4px 14px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

#toothShadeSlider {
  grid-row: 2;
  grid-column: 1;
  z-index: 2;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

#toothShadeSlider::-webkit-slider-runnable-track {
  background: transparent !important;
  box-shadow: none !important;
}

#toothShadeSlider::-moz-range-track {
  background: transparent !important;
  box-shadow: none !important;
}

body.preview-locked .tooth-shade-control[aria-hidden="false"] {
  display: grid !important;
}

.mouth-guide-single-image {
  background: rgba(239, 250, 247, 0.28) !important;
}

.mouth-guide-single-image .mouth-guide-image {
  object-fit: contain !important;
}

.library-guide-single-image {
  width: min(292px, 74vw) !important;
  height: min(208px, 27dvh) !important;
  background: rgba(241, 252, 249, 0.54) !important;
}

.library-guide-single-image .library-guide-image {
  object-fit: contain !important;
  object-position: center center !important;
}

@media (max-width: 430px) {
  .locked-edit-button {
    bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .tooth-shade-control::before {
    height: 128px;
  }

  .library-guide-single-image {
    width: min(278px, 74vw) !important;
    height: min(194px, 25dvh) !important;
  }
}


/* DIMIR v69 always-visible shade control while teeth are visible */
body.teeth-preview-visible .tooth-shade-control[aria-hidden="false"],
body.preview-locked.teeth-preview-visible .tooth-shade-control[aria-hidden="false"] {
  display: grid !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.tooth-shade-control::before {
  display: block !important;
  justify-self: center !important;
  align-self: center !important;
}

#toothShadeSlider {
  opacity: 1 !important;
}


/* DIMIR v73 custom visible shade handle and guide-line persistence */
.tooth-shade-control {
  --shade-thumb-top: 96px;
  overflow: visible !important;
}

.tooth-shade-control::before {
  position: absolute !important;
  left: 50% !important;
  top: 38px !important;
  bottom: 38px !important;
  width: 9px !important;
  height: auto !important;
  grid-row: auto !important;
  grid-column: auto !important;
  transform: translateX(-50%) !important;
  z-index: 0 !important;
}

.tooth-shade-control::after {
  content: "";
  position: absolute;
  left: 50%;
  top: var(--shade-thumb-top);
  z-index: 3;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  background: radial-gradient(circle at 34% 28%, #ffffff 0%, #fffdf8 44%, #f2e5d2 100%);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#toothShadeSlider {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  z-index: 4 !important;
  width: 158px !important;
  height: 44px !important;
  opacity: 0.02 !important;
  transform: translate(-50%, -50%) rotate(-90deg) !important;
  touch-action: none !important;
}

#toothShadeSlider::-webkit-slider-thumb {
  opacity: 0 !important;
}

#toothShadeSlider::-moz-range-thumb {
  opacity: 0 !important;
}

@media (max-width: 430px) {
  .tooth-shade-control::before {
    top: 34px !important;
    bottom: 34px !important;
  }

  .tooth-shade-control::after {
    width: 22px;
    height: 22px;
  }

  #toothShadeSlider {
    width: 136px !important;
  }
}


/* DIMIR v73 direct touch drag for custom shade control */
.tooth-shade-control {
  touch-action: none !important;
  cursor: ns-resize;
}

.tooth-shade-control::after {
  transition: top 0.04s linear, transform 0.12s ease, box-shadow 0.12s ease;
}

.tooth-shade-control:active::after {
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.78);
}

#toothShadeSlider {
  pointer-events: none !important;
}


/* DIMIR v73 shade control without lower A3 label */
.tooth-shade-label-warm {
  display: none !important;
}


/* DIMIR v80 clearer guide copy support */
.help-panel {
  max-height: min(86dvh, 760px) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

.guide-steps li {
  grid-template-columns: 92px 1fr !important;
}

.guide-steps span {
  line-height: 1.42 !important;
}

.capture-instruction-card {
  max-height: calc(100dvh - 128px - env(safe-area-inset-bottom)) !important;
  overflow-y: auto !important;
}

.capture-instruction-copy,
.capture-instruction-subcopy {
  max-width: 40ch !important;
}

.editor-instruction-card {
  max-height: calc(100dvh - 132px - env(safe-area-inset-bottom)) !important;
  overflow-y: auto !important;
}

.editor-guide-steps li {
  line-height: 1.28 !important;
}

@media (max-width: 430px) {
  .guide-steps li {
    grid-template-columns: 76px 1fr !important;
  }

  .guide-steps span {
    font-size: 13px !important;
  }
}


/* DIMIR v82: camera guide eye line and home music support */
.face-guide-diagram .diagram-eye-line {
  top: 46.7% !important;
}

@media (max-width: 430px) {
  .face-guide-diagram .diagram-eye-line {
    top: 46.9% !important;
  }
}


/* DIMIR v87 in-app privacy sheet */
.landing-privacy-link {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  padding: 0 0 2px;
}

.privacy-panel {
  max-height: min(82dvh, 700px) !important;
}

.privacy-sheet-copy {
  display: grid;
  gap: 10px;
  color: rgba(45, 35, 32, 0.78);
}

.privacy-sheet-copy p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.48;
}

.privacy-sheet-copy h4 {
  margin: 12px 0 0;
  color: #17443f;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}


/* DIMIR v88 premium locks and non-tracking ad moments */
.template-card {
  position: relative;
}

.template-card.is-locked {
  opacity: 0.72;
}

.template-card.is-locked .template-line-canvas {
  filter: grayscale(1) opacity(0.62);
}

.template-lock-badge {
  position: absolute;
  right: 8px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(21, 69, 64, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 18px rgba(22, 47, 43, 0.12);
}

.css-lock {
  position: relative;
  width: 11px;
  height: 9px;
  border: 2px solid #1f5b54;
  border-radius: 2px;
}

.css-lock::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -9px;
  width: 10px;
  height: 10px;
  border: 2px solid #1f5b54;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  transform: translateX(-50%);
}

.tooth-shade-control.is-premium-locked {
  cursor: pointer;
}

.tooth-shade-control.is-premium-locked::after {
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28), inset 0 0 0 2px rgba(31, 91, 84, 0.22) !important;
}

.tooth-shade-control.is-premium-locked .tooth-shade-label-light {
  font-size: 0;
}

.tooth-shade-control.is-premium-locked .tooth-shade-label-light::after {
  content: "LOCK";
  font-size: 12px;
  letter-spacing: 0.08em;
}

.commerce-sheet {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: none;
}

.commerce-sheet.is-open {
  display: block;
}

.commerce-scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 19, 18, 0.42);
  backdrop-filter: blur(12px);
}

.commerce-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(368px, calc(100vw - 34px));
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 0%, rgba(201, 246, 238, 0.72), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 250, 247, 0.94));
  box-shadow: 0 30px 80px rgba(8, 22, 20, 0.32);
  padding: 24px;
  color: #153f3a;
  text-align: left;
  animation: premiumPop 180ms ease-out;
}

@keyframes premiumPop {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.commerce-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(21, 63, 58, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #153f3a;
  font-size: 24px;
  line-height: 1;
}

.commerce-panel h3 {
  margin: 8px 0 10px;
  font-size: 29px;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.premium-reason,
.ad-panel p,
.premium-note {
  margin: 0;
  color: rgba(24, 55, 51, 0.72);
  font-size: 14px;
  line-height: 1.45;
}

.premium-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 18px 0 14px;
}

.premium-price-row strong {
  font-size: 42px;
  letter-spacing: -0.04em;
}

.premium-was {
  color: rgba(29, 58, 54, 0.42);
  font-size: 18px;
  font-weight: 850;
  text-decoration: line-through;
}

.premium-save {
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(45, 132, 122, 0.12);
  color: #1f6a62;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.premium-benefits {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.premium-benefits li {
  position: relative;
  padding-left: 22px;
  color: rgba(21, 63, 58, 0.82);
  font-size: 14px;
  font-weight: 760;
}

.premium-benefits li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #2d847a;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.78);
}

.premium-purchase-button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #2f8b81, #176159);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(23, 97, 89, 0.25);
}

.premium-note {
  margin-top: 12px;
  font-size: 12px;
}

.ad-panel {
  text-align: center;
}

.ad-panel h3 {
  margin-top: 4px;
}

.ad-close-button {
  margin-top: 18px;
}


/* DIMIR v89 share-timed ad and real lock icon */
.template-lock-badge {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  color: #1f5b54;
}

.template-lock-badge::before {
  inset: 3px !important;
}

.css-lock,
.css-lock::before {
  display: none !important;
}

.tooth-shade-control.is-premium-locked .tooth-shade-label-light {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 18px;
  color: rgba(255, 255, 255, 0.98);
}

.tooth-shade-control.is-premium-locked .tooth-shade-label-light::after {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: url("assets/Icons/rock.svg") center / contain no-repeat;
  mask: url("assets/Icons/rock.svg") center / contain no-repeat;
}

/* DIMIR v94 iOS safe-area and icon polish */
html {
  width: 100%;
  min-height: 100%;
  background: #0b0e0d;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  width: 100%;
  min-height: 100dvh;
  background: #0b0e0d !important;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button,
a,
label,
.tool-button,
.mode-toggle,
.landing-start,
.landing-how,
.landing-privacy-link {
  touch-action: manipulation;
}

@media (max-width: 760px) {
  .app-shell,
  .layout,
  .workspace,
  .photo-stage {
    width: 100vw !important;
    min-height: 100dvh !important;
    height: 100dvh !important;
    overflow: hidden !important;
    background-color: #0b0e0d !important;
  }

  body:not(.has-photo) .landing-hero {
    min-height: 100dvh !important;
    height: 100dvh !important;
    background-color: #0b0e0d !important;
  }

  body:not(.has-photo) .landing-copy {
    top: max(112px, calc(72px + env(safe-area-inset-top))) !important;
  }

  body:not(.has-photo) .landing-copy h3 span:first-child {
    font-size: clamp(48px, 12vw, 70px) !important;
    line-height: 0.98 !important;
  }

  body:not(.has-photo) .landing-copy h3 span + span {
    font-size: clamp(28px, 7.8vw, 42px) !important;
    line-height: 1.05 !important;
  }

  body:not(.has-photo) .landing-copy > p:not(.landing-kicker) {
    margin-top: 4px !important;
  }

  body:not(.has-photo) .landing-actions {
    bottom: max(34px, calc(22px + env(safe-area-inset-bottom))) !important;
  }

  body:not(.has-photo) .landing-brand {
    bottom: max(136px, calc(116px + env(safe-area-inset-bottom))) !important;
  }

  body.has-photo .topbar {
    padding-top: max(42px, calc(16px + env(safe-area-inset-top))) !important;
  }

  body.has-photo .editor-brand-lockup {
    top: max(42px, calc(16px + env(safe-area-inset-top))) !important;
  }

  body.has-photo .editor-guide-button {
    top: max(42px, calc(16px + env(safe-area-inset-top))) !important;
  }

  body.has-photo .library-pull-tab,
  body.has-photo .library-handle,
  body.has-photo .template-library-handle {
    top: max(0px, env(safe-area-inset-top)) !important;
  }

  body.has-photo .top-edit-switch {
    top: max(96px, calc(66px + env(safe-area-inset-top))) !important;
  }

  body.has-photo .floating-tools {
    left: 50% !important;
    right: auto !important;
    width: min(410px, calc(100vw - 18px)) !important;
    bottom: max(24px, calc(18px + env(safe-area-inset-bottom))) !important;
    transform: translateX(-50%) !important;
  }

  body.has-photo .bottom-toolbar.dimir-action-toolbar {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
}

@media (max-width: 390px) {
  body.has-photo .floating-tools {
    width: calc(100vw - 14px) !important;
  }

  body.has-photo .bottom-toolbar.dimir-action-toolbar .tool-button {
    min-width: 0 !important;
  }

  body.has-photo .bottom-toolbar.dimir-action-toolbar .tool-label {
    font-size: 8.8px !important;
  }
}

/* DIMIR v95 library dynamic-island clearance */
@media (max-width: 760px) {
  body.has-photo .template-library {
    top: 0 !important;
    padding-top: max(100px, calc(66px + env(safe-area-inset-top))) !important;
    transform: translateY(calc(-100% + max(96px, calc(64px + env(safe-area-inset-top))))) !important;
  }

  body.has-photo .template-library.is-open {
    transform: translateY(0) !important;
  }

  body.has-photo .template-library-panel {
    padding-top: max(92px, calc(58px + env(safe-area-inset-top))) !important;
    max-height: min(56dvh, 480px) !important;
  }

  body.has-photo .template-library-tab {
    margin-top: 0 !important;
    transform: translateY(0) !important;
  }

  body.has-photo .template-library.is-open .template-library-tab {
    transform: translateY(0) !important;
  }
}

@media (max-width: 430px) {
  body.has-photo .template-library {
    padding-top: max(106px, calc(72px + env(safe-area-inset-top))) !important;
    transform: translateY(calc(-100% + max(102px, calc(70px + env(safe-area-inset-top))))) !important;
  }

  body.has-photo .template-library.is-open {
    transform: translateY(0) !important;
  }

  body.has-photo .template-library-panel {
    padding-top: max(98px, calc(64px + env(safe-area-inset-top))) !important;
    max-height: min(56dvh, 470px) !important;
  }
}

/* DIMIR v96 library lock and portrait guard */
@media (max-width: 760px) {
  body.has-photo .template-library {
    padding-top: max(92px, calc(58px + env(safe-area-inset-top))) !important;
    transform: translateY(calc(-100% + max(78px, calc(48px + env(safe-area-inset-top))))) !important;
  }

  body.has-photo .template-library.is-open {
    transform: translateY(0) !important;
  }

  body.has-photo .template-library-panel {
    padding-top: max(84px, calc(52px + env(safe-area-inset-top))) !important;
  }
}

@media (max-width: 430px) {
  body.has-photo .template-library {
    padding-top: max(96px, calc(62px + env(safe-area-inset-top))) !important;
    transform: translateY(calc(-100% + max(84px, calc(54px + env(safe-area-inset-top))))) !important;
  }

  body.has-photo .template-library.is-open {
    transform: translateY(0) !important;
  }

  body.has-photo .template-library-panel {
    padding-top: max(88px, calc(56px + env(safe-area-inset-top))) !important;
  }
}

.template-card.is-locked .template-lock-badge {
  position: absolute !important;
  left: 50% !important;
  top: 42% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  z-index: 5 !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  color: #1d6159 !important;
  background: rgba(246, 255, 253, 0.94) !important;
  border: 1px solid rgba(55, 130, 122, 0.24) !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 18px rgba(9, 35, 32, 0.18) !important;
}

.template-card.is-locked .template-lock-badge::before {
  inset: 5px !important;
}

@media (orientation: landscape) and (max-width: 940px) {
  body::before {
    content: "Please rotate your phone to portrait mode.";
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: grid;
    place-items: center;
    padding: 28px;
    background: #07110f;
    color: #f7fffb;
    font: 800 20px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    text-align: center;
  }
}

/* DIMIR v97 final native polish: library curtain, lock centering, portrait/safe-area guards */
html,
body {
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

button,
[role="button"],
.tool-button,
.template-library-tab,
.template-card,
.landing-action {
  touch-action: manipulation;
}

@media (orientation: landscape) and (max-width: 940px) {
  body > *:not(style):not(script) {
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body::before {
    visibility: visible !important;
  }
}

@media (max-width: 760px) {
  body.has-photo .template-library {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 13020 !important;
    display: block !important;
    padding: 0 !important;
    pointer-events: none !important;
    transform: translateY(calc(-100% + max(68px, calc(42px + env(safe-area-inset-top))))) !important;
    transition: transform 560ms cubic-bezier(0.16, 1, 0.3, 1), filter 260ms ease !important;
  }

  body.has-photo .template-library.is-open {
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }

  body.has-photo .template-library-panel {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    min-height: min(63dvh, 590px) !important;
    max-height: min(68dvh, 620px) !important;
    margin: 0 !important;
    padding: max(54px, calc(22px + env(safe-area-inset-top))) 18px max(68px, calc(54px + env(safe-area-inset-bottom))) !important;
    display: grid !important;
    grid-template-rows: auto auto minmax(170px, 1fr) auto auto !important;
    gap: 10px !important;
    border-radius: 0 0 30px 30px !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 0 !important;
    background:
      linear-gradient(180deg, rgba(248, 255, 252, 0.985), rgba(235, 250, 246, 0.96) 76%, rgba(228, 246, 241, 0.94)) !important;
    box-shadow: 0 34px 80px rgba(5, 18, 16, 0.34) !important;
    backdrop-filter: blur(28px) saturate(1.14) !important;
    -webkit-backdrop-filter: blur(28px) saturate(1.14) !important;
    pointer-events: auto !important;
  }

  body.has-photo .template-library-header {
    order: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 12px !important;
  }

  body.has-photo .template-library-header .eyebrow {
    font-size: 10px !important;
    letter-spacing: 0.18em !important;
    margin: 0 0 3px !important;
  }

  body.has-photo .template-library-header h3 {
    font-size: clamp(20px, 5.1vw, 28px) !important;
    line-height: 1.04 !important;
    margin: 0 !important;
  }

  body.has-photo .template-strip {
    order: 1 !important;
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 1px 0 2px !important;
  }

  body.has-photo .template-card {
    position: relative !important;
    min-height: 76px !important;
    grid-template-rows: 38px 20px 5px !important;
    gap: 2px !important;
    padding: 7px 4px 6px !important;
    border-radius: 14px !important;
  }

  body.has-photo .template-card canvas {
    height: 38px !important;
  }

  body.has-photo .template-card span {
    font-size: clamp(9px, 2.4vw, 12px) !important;
    line-height: 1.05 !important;
    text-align: center !important;
  }

  body.has-photo .template-card.is-locked .template-lock-badge {
    left: 50% !important;
    top: calc(50% - 3px) !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    width: 27px !important;
    height: 27px !important;
    min-width: 27px !important;
    min-height: 27px !important;
    display: grid !important;
    place-items: center !important;
  }

  body.has-photo .template-preview-row {
    order: 2 !important;
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) 42px !important;
    align-items: center !important;
    gap: 9px !important;
    margin: 0 !important;
  }

  body.has-photo .template-preview-frame {
    width: 100% !important;
    height: clamp(168px, 23dvh, 238px) !important;
    min-height: 168px !important;
    border-radius: 20px !important;
  }

  body.has-photo .template-preview-frame img {
    inset: 10px 18px !important;
    width: calc(100% - 36px) !important;
    height: calc(100% - 20px) !important;
    object-fit: contain !important;
  }

  body.has-photo .template-nav-button {
    width: 42px !important;
    min-width: 42px !important;
    height: 88px !important;
    border-radius: 18px !important;
  }

  body.has-photo .template-copy {
    order: 3 !important;
    justify-content: center !important;
    gap: 8px !important;
    margin: 0 !important;
    text-align: center !important;
  }

  body.has-photo .template-copy strong {
    font-size: clamp(19px, 4.6vw, 25px) !important;
  }

  body.has-photo .template-copy span {
    font-size: clamp(12px, 3.1vw, 16px) !important;
  }

  body.has-photo .template-apply-button {
    order: 4 !important;
    min-width: min(290px, 72vw) !important;
    min-height: 48px !important;
    justify-self: center !important;
    align-self: end !important;
    padding: 0 26px !important;
    font-size: 16px !important;
    box-shadow: 0 14px 30px rgba(23, 110, 99, 0.18) !important;
  }

  body.has-photo .template-library-tab {
    width: 104px !important;
    min-height: max(58px, calc(34px + env(safe-area-inset-top))) !important;
    margin: 0 auto !important;
    padding-top: max(7px, env(safe-area-inset-top)) !important;
    border-radius: 0 0 24px 24px !important;
    transform: translateY(0) !important;
    box-shadow: 0 14px 34px rgba(7, 25, 22, 0.20) !important;
  }

  body.has-photo .template-library.is-open .template-library-tab {
    margin-top: -2px !important;
    transform: translateY(0) !important;
  }

  body.template-library-open .editor-brand-lockup,
  body.template-library-open .editor-guide-button,
  body.template-library-open .top-edit-switch {
    z-index: 12 !important;
    opacity: 0.08 !important;
    pointer-events: none !important;
  }
}

@media (max-width: 430px) {
  body.has-photo .template-library {
    transform: translateY(calc(-100% + max(64px, calc(38px + env(safe-area-inset-top))))) !important;
  }

  body.has-photo .template-library-panel {
    min-height: min(61dvh, 560px) !important;
    max-height: min(66dvh, 590px) !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 8px !important;
  }

  body.has-photo .template-strip {
    gap: 5px !important;
  }

  body.has-photo .template-card {
    min-height: 68px !important;
    padding: 6px 3px 5px !important;
  }

  body.has-photo .template-card canvas {
    height: 34px !important;
  }

  body.has-photo .template-preview-row {
    grid-template-columns: 34px minmax(0, 1fr) 34px !important;
    gap: 6px !important;
  }

  body.has-photo .template-nav-button {
    width: 34px !important;
    min-width: 34px !important;
    height: 78px !important;
  }

  body.has-photo .template-preview-frame {
    height: clamp(154px, 21dvh, 208px) !important;
  }
}


/* DIMIR v98 library proportion pass: compact 5-column grid and non-stretched teeth */
@media (max-width: 760px) {
  body.has-photo .template-library {
    transform: translateY(calc(-100% + max(72px, calc(44px + env(safe-area-inset-top))))) !important;
  }

  body.has-photo .template-library-panel {
    min-height: min(60dvh, 560px) !important;
    max-height: min(64dvh, 590px) !important;
    padding: max(42px, calc(18px + env(safe-area-inset-top))) 18px max(78px, calc(60px + env(safe-area-inset-bottom))) !important;
    grid-template-rows: auto auto minmax(126px, 1fr) auto !important;
    gap: 10px !important;
  }

  body.has-photo .template-library-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: start !important;
    column-gap: 12px !important;
  }

  body.has-photo .template-library-header h3 {
    max-width: 14.5em !important;
    font-size: clamp(22px, 5.8vw, 31px) !important;
    line-height: 0.98 !important;
    letter-spacing: -0.01em !important;
  }

  body.has-photo .template-apply-button {
    min-width: 92px !important;
    width: 92px !important;
    min-height: 40px !important;
    padding: 0 14px !important;
    font-size: 14px !important;
    justify-self: end !important;
    border-radius: 999px !important;
  }

  body.has-photo .template-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-auto-rows: 74px !important;
    gap: 7px !important;
    align-items: stretch !important;
    order: 1 !important;
  }

  body.has-photo .template-card {
    min-height: 74px !important;
    height: 74px !important;
    grid-template-rows: 40px 18px 4px !important;
    padding: 6px 4px 5px !important;
    border-radius: 14px !important;
  }

  body.has-photo .template-card .template-line-canvas,
  body.has-photo .template-card canvas {
    width: min(100%, 58px) !important;
    height: auto !important;
    aspect-ratio: 156 / 72 !important;
    align-self: center !important;
    justify-self: center !important;
  }

  body.has-photo .template-card span {
    font-size: clamp(9px, 2.55vw, 12px) !important;
    font-weight: 820 !important;
  }

  body.has-photo .template-card.is-locked .template-lock-badge {
    left: 50% !important;
    top: 27px !important;
    transform: translate(-50%, -50%) !important;
    width: 25px !important;
    height: 25px !important;
    min-width: 25px !important;
    min-height: 25px !important;
  }

  body.has-photo .template-preview-row {
    grid-template-columns: 36px minmax(0, 1fr) 36px !important;
    gap: 8px !important;
    order: 2 !important;
  }

  body.has-photo .template-preview-frame {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 3.25 / 1 !important;
    max-height: 172px !important;
    border-radius: 20px !important;
  }

  body.has-photo .template-preview-frame img {
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    height: auto !important;
    max-width: 86% !important;
    max-height: 72% !important;
    transform: translate(-50%, -50%) !important;
    object-fit: contain !important;
  }

  body.has-photo .template-preview-frame canvas {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  body.has-photo .template-nav-button {
    width: 36px !important;
    min-width: 36px !important;
    height: 78px !important;
    border-radius: 17px !important;
  }

  body.has-photo .template-copy {
    order: 3 !important;
    margin-top: -2px !important;
  }

  body.has-photo .template-copy strong {
    font-size: clamp(20px, 5vw, 28px) !important;
  }

  body.has-photo .template-copy span {
    font-size: clamp(12px, 3.2vw, 16px) !important;
  }

  body.has-photo .template-library-tab {
    width: 124px !important;
    min-height: max(74px, calc(42px + env(safe-area-inset-top))) !important;
    grid-template-rows: 4px 18px 16px !important;
    gap: 7px !important;
  }

  body.has-photo .template-tab-label {
    font-size: 13px !important;
    letter-spacing: 0.14em !important;
    line-height: 1 !important;
  }

  body.has-photo .template-tab-arrow {
    width: 14px !important;
    height: 14px !important;
    border-right-width: 3px !important;
    border-bottom-width: 3px !important;
  }
}

@media (max-width: 430px) {
  body.has-photo .template-library-panel {
    min-height: min(59dvh, 540px) !important;
    max-height: min(63dvh, 570px) !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 8px !important;
  }

  body.has-photo .template-strip {
    gap: 5px !important;
    grid-auto-rows: 66px !important;
  }

  body.has-photo .template-card {
    height: 66px !important;
    min-height: 66px !important;
    grid-template-rows: 35px 17px 4px !important;
    padding: 5px 3px 4px !important;
  }

  body.has-photo .template-card.is-locked .template-lock-badge {
    top: 24px !important;
    width: 23px !important;
    height: 23px !important;
    min-width: 23px !important;
    min-height: 23px !important;
  }

  body.has-photo .template-preview-row {
    grid-template-columns: 30px minmax(0, 1fr) 30px !important;
    gap: 6px !important;
  }

  body.has-photo .template-preview-frame {
    aspect-ratio: 3.15 / 1 !important;
    max-height: 142px !important;
  }

  body.has-photo .template-nav-button {
    width: 30px !important;
    min-width: 30px !important;
    height: 68px !important;
  }
}


/* DIMIR v99 premium close and centered full lock icon */
.commerce-close {
  display: grid !important;
  place-items: center !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

.commerce-close span,
.commerce-close::before,
.commerce-close::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 15px !important;
  height: 2px !important;
  border-radius: 999px !important;
  background: #153f3a !important;
  transform-origin: center !important;
}

.commerce-close span {
  display: none !important;
}

.commerce-close::before {
  transform: translate(-50%, -50%) rotate(45deg) !important;
}

.commerce-close::after {
  display: block !important;
  transform: translate(-50%, -50%) rotate(-45deg) !important;
}

body.has-photo .template-card.is-locked .template-lock-badge,
.template-card.is-locked .template-lock-badge {
  overflow: visible !important;
  display: block !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(31, 91, 84, 0.2) !important;
  color: #2f6f68 !important;
  box-shadow: 0 8px 18px rgba(14, 43, 39, 0.18) !important;
}

body.has-photo .template-card.is-locked .template-lock-badge::before,
.template-card.is-locked .template-lock-badge::before {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 58% !important;
  height: 58% !important;
  inset: auto !important;
  background: currentColor !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: translate(-50%, -50%) !important;
  -webkit-mask: url("assets/Icons/rock.svg") center / contain no-repeat !important;
  mask: url("assets/Icons/rock.svg") center / contain no-repeat !important;
}

body.has-photo .template-card.is-locked .template-lock-badge::after,
.template-card.is-locked .template-lock-badge::after {
  content: none !important;
  display: none !important;
}


/* DIMIR v100 premium library redesign and calmer tooth rotation support */
.commerce-sheet {
  z-index: 32000 !important;
}

.premium-panel {
  overflow: hidden !important;
}

.premium-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: rgba(22, 58, 54, 0.78);
  font-weight: 900;
  letter-spacing: 0.34em;
}

.premium-brand-lockup img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  opacity: 0.78;
}

.premium-brand-lockup span {
  font-size: 13px;
}

body.has-photo .template-card.is-locked .template-lock-badge::before,
.template-card.is-locked .template-lock-badge::before {
  top: 55% !important;
  width: 54% !important;
  height: 54% !important;
}

.template-card-coming {
  pointer-events: none !important;
  color: rgba(30, 72, 67, 0.42) !important;
  border-style: dashed !important;
  background: rgba(255, 255, 255, 0.34) !important;
  box-shadow: none !important;
}

.template-card-coming .coming-line {
  align-self: center !important;
  justify-self: center !important;
  width: 42px !important;
  height: 18px !important;
  border: 2px solid rgba(38, 113, 105, 0.18) !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-radius: 999px !important;
}

.template-card-coming span:last-child {
  color: rgba(28, 75, 70, 0.48) !important;
  font-size: 10px !important;
  letter-spacing: 0.08em !important;
}

@media (max-width: 760px) {
  body.has-photo .template-library-panel {
    min-height: auto !important;
    max-height: min(58dvh, 540px) !important;
    padding: max(42px, calc(18px + env(safe-area-inset-top))) 18px max(66px, calc(50px + env(safe-area-inset-bottom))) !important;
    grid-template-rows: auto auto auto auto !important;
    gap: 12px !important;
    background:
      radial-gradient(circle at 72% 22%, rgba(188, 232, 225, 0.24), transparent 38%),
      linear-gradient(180deg, rgba(248, 255, 253, 0.98), rgba(238, 249, 246, 0.95)) !important;
  }

  body.has-photo .template-library-header {
    align-items: center !important;
    column-gap: 10px !important;
  }

  body.has-photo .template-library-header h3 {
    max-width: 12.8em !important;
    font-size: clamp(21px, 5.3vw, 28px) !important;
    line-height: 1.02 !important;
  }

  body.has-photo .template-apply-button {
    width: 82px !important;
    min-width: 82px !important;
    min-height: 38px !important;
    font-size: 13px !important;
    padding: 0 12px !important;
  }

  body.has-photo .template-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-auto-rows: 78px !important;
    gap: 8px !important;
    margin-top: 4px !important;
  }

  body.has-photo .template-card {
    height: 78px !important;
    min-height: 78px !important;
    grid-template-rows: 42px 18px 4px !important;
    padding: 7px 4px 5px !important;
    border-radius: 15px !important;
  }

  body.has-photo .template-card.is-locked .template-lock-badge {
    top: 31px !important;
    width: 27px !important;
    height: 27px !important;
    min-width: 27px !important;
    min-height: 27px !important;
  }

  body.has-photo .template-preview-row {
    grid-template-columns: 38px minmax(0, 1fr) 38px !important;
    gap: 8px !important;
    margin-top: 6px !important;
  }

  body.has-photo .template-preview-frame {
    aspect-ratio: 2.6 / 1 !important;
    max-height: 188px !important;
    min-height: 126px !important;
    border-radius: 22px !important;
  }

  body.has-photo .template-preview-frame img {
    max-width: 92% !important;
    max-height: 82% !important;
  }

  body.has-photo .template-copy {
    margin-top: -1px !important;
    justify-content: center !important;
    gap: 10px !important;
  }

  body.has-photo .template-library-tab {
    width: 124px !important;
    min-height: max(70px, calc(40px + env(safe-area-inset-top))) !important;
    grid-template-rows: 4px 16px 14px !important;
    gap: 5px !important;
    padding-bottom: 8px !important;
  }

  body.has-photo .template-tab-label {
    transform: translateY(-2px) !important;
  }

  body.has-photo .template-tab-arrow {
    transform: translateY(-3px) rotate(45deg) !important;
  }

  body.has-photo .template-library.is-open .template-tab-arrow {
    transform: translateY(-2px) rotate(-135deg) !important;
  }
}

@media (max-width: 430px) {
  body.has-photo .template-library-panel {
    max-height: min(57dvh, 520px) !important;
    gap: 10px !important;
  }

  body.has-photo .template-strip {
    grid-auto-rows: 72px !important;
    gap: 7px !important;
  }

  body.has-photo .template-card {
    height: 72px !important;
    min-height: 72px !important;
    grid-template-rows: 38px 17px 4px !important;
  }

  body.has-photo .template-card.is-locked .template-lock-badge {
    top: 29px !important;
    width: 25px !important;
    height: 25px !important;
    min-width: 25px !important;
    min-height: 25px !important;
  }

  body.has-photo .template-preview-frame {
    aspect-ratio: 2.45 / 1 !important;
    max-height: 162px !important;
    min-height: 118px !important;
  }
}


/* DIMIR v101 clearer library handle label */
@media (max-width: 760px) {
  body.has-photo .template-tab-label {
    font-size: 15px !important;
    letter-spacing: 0.13em !important;
    font-weight: 950 !important;
  }
}

@media (max-width: 430px) {
  body.has-photo .template-tab-label {
    font-size: 14px !important;
    letter-spacing: 0.12em !important;
  }
}


/* DIMIR v102 wider blue library handle chevron */
@media (max-width: 760px) {
  body.has-photo .template-library-tab {
    grid-template-rows: 4px 17px 18px !important;
    gap: 3px !important;
    padding-top: 6px !important;
    padding-bottom: 10px !important;
  }

  body.has-photo .template-tab-grip {
    transform: translateY(-3px) !important;
  }

  body.has-photo .template-tab-label {
    transform: translateY(-4px) !important;
  }

  body.has-photo .template-tab-arrow {
    position: relative !important;
    width: 32px !important;
    height: 16px !important;
    border: 0 !important;
    transform: translateY(-5px) !important;
  }

  body.has-photo .template-tab-arrow::before,
  body.has-photo .template-tab-arrow::after {
    content: "" !important;
    position: absolute !important;
    top: 7px !important;
    width: 19px !important;
    height: 4px !important;
    border-radius: 999px !important;
    background: #159bd3 !important;
    box-shadow: 0 2px 7px rgba(21, 155, 211, 0.25) !important;
  }

  body.has-photo .template-tab-arrow::before {
    left: 0 !important;
    transform: rotate(36deg) !important;
    transform-origin: right center !important;
  }

  body.has-photo .template-tab-arrow::after {
    right: 0 !important;
    transform: rotate(-36deg) !important;
    transform-origin: left center !important;
  }

  body.has-photo .template-library.is-open .template-tab-arrow {
    transform: translateY(-4px) rotate(180deg) !important;
  }
}

@media (max-width: 430px) {
  body.has-photo .template-tab-arrow {
    width: 30px !important;
    height: 15px !important;
  }

  body.has-photo .template-tab-arrow::before,
  body.has-photo .template-tab-arrow::after {
    width: 18px !important;
    height: 4px !important;
  }
}

/* DIMIR v103 share export, library handle clearance, premium logo, and edit spacing */
@media (max-width: 760px) {
  body.has-photo .template-library {
    transform: translateY(calc(-100% + max(112px, calc(78px + env(safe-area-inset-top))))) !important;
  }

  body.has-photo .template-library.is-open {
    transform: translateY(0) !important;
  }

  body.has-photo .template-library-tab {
    width: 126px !important;
    min-height: max(82px, calc(54px + env(safe-area-inset-top))) !important;
    grid-template-rows: 5px 20px 22px !important;
    align-content: end !important;
    gap: 5px !important;
    padding-top: max(14px, env(safe-area-inset-top)) !important;
    padding-bottom: 12px !important;
    border-radius: 0 0 26px 26px !important;
  }

  body.has-photo .template-tab-grip {
    width: 46px !important;
    height: 4px !important;
    transform: none !important;
  }

  body.has-photo .template-tab-label {
    font-size: 15px !important;
    line-height: 1 !important;
    transform: none !important;
  }

  body.has-photo .template-tab-arrow {
    width: 36px !important;
    height: 18px !important;
    transform: none !important;
  }

  body.has-photo .template-tab-arrow::before,
  body.has-photo .template-tab-arrow::after {
    top: 8px !important;
    width: 21px !important;
    height: 4px !important;
    background: #159bd3 !important;
  }

  body.has-photo .template-library.is-open .template-tab-arrow {
    transform: rotate(180deg) !important;
  }
}

@media (max-width: 430px) {
  body.has-photo .template-library {
    transform: translateY(calc(-100% + max(106px, calc(74px + env(safe-area-inset-top))))) !important;
  }

  body.has-photo .template-library-tab {
    min-height: max(80px, calc(52px + env(safe-area-inset-top))) !important;
    grid-template-rows: 5px 19px 21px !important;
    padding-bottom: 12px !important;
  }
}

.premium-brand-lockup {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 0 0 14px !important;
  color: rgba(19, 58, 53, 0.9) !important;
}

.premium-brand-lockup img {
  width: 42px !important;
  height: 42px !important;
  border-radius: 12px !important;
  object-fit: cover !important;
  opacity: 1 !important;
  box-shadow: 0 10px 24px rgba(9, 27, 24, 0.14) !important;
}

.premium-brand-lockup span {
  font-size: 15px !important;
  font-weight: 900 !important;
  letter-spacing: 0.32em !important;
}

.locked-edit-button {
  bottom: calc(114px + env(safe-area-inset-bottom)) !important;
}

@media (max-width: 430px) {
  .locked-edit-button {
    bottom: calc(108px + env(safe-area-inset-bottom)) !important;
  }
}

/* DIMIR v104: compact library handle and stable in-handle chevron */
@media (max-width: 760px) {
  body.has-photo .template-library {
    transform: translateY(calc(-100% + max(92px, calc(45px + env(safe-area-inset-top))))) !important;
  }

  body.has-photo .template-library.is-open {
    transform: translateY(0) !important;
  }

  body.has-photo .template-library-tab {
    width: 126px !important;
    min-height: 74px !important;
    grid-template-rows: 4px 18px 18px !important;
    align-content: end !important;
    gap: 4px !important;
    padding-top: 8px !important;
    padding-bottom: 9px !important;
    border-radius: 0 0 26px 26px !important;
  }

  body.has-photo .template-tab-grip {
    width: 46px !important;
    height: 4px !important;
    transform: none !important;
  }

  body.has-photo .template-tab-label {
    font-size: 15px !important;
    line-height: 1 !important;
    transform: none !important;
  }

  body.has-photo .template-tab-arrow {
    width: 36px !important;
    height: 18px !important;
    transform: none !important;
  }

  body.has-photo .template-tab-arrow::before,
  body.has-photo .template-tab-arrow::after {
    top: 8px !important;
    width: 21px !important;
    height: 4px !important;
    background: #159bd3 !important;
  }

  body.has-photo .template-library.is-open .template-tab-arrow {
    transform: rotate(180deg) !important;
  }
}

@media (max-width: 430px) {
  body.has-photo .template-library {
    transform: translateY(calc(-100% + max(88px, calc(42px + env(safe-area-inset-top))))) !important;
  }

  body.has-photo .template-library-tab {
    min-height: 72px !important;
    grid-template-rows: 4px 18px 18px !important;
    padding-top: 7px !important;
    padding-bottom: 9px !important;
  }
}

