/* ========================================================
   4. MAIN APP DIALOG STYLES (MODAL)
   ======================================================== */
.portrait-dialog { width: 100%; max-width: 100vw; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--text); overflow: hidden; }
.portrait-dialog[open] { display: grid; place-items: center; }
.portrait-dialog::backdrop { background: rgba(0,4,6,.9); backdrop-filter: blur(14px); }
.modal-shell {
  position: relative; width: min(100%, calc(100dvh * 4 / 9)); max-width: 100%; height: min(100dvh, calc(100vw * 9 / 4));
  aspect-ratio: 4 / 9; overflow: hidden; container-type: inline-size; isolation: isolate;
  background: linear-gradient(90deg, rgba(5,5,5,.99) 0 53%, rgba(16,16,16,.9) 73%, rgba(5,5,5,.72) 100%), linear-gradient(180deg, rgba(10,186,181,.16), rgba(5,5,5,.94)), var(--nanno-modal-bg-url, url("/static/images/modal-lab-bg.jpg")) right center / 64% 100% no-repeat;
  box-shadow: 0 0 90px rgba(0,0,0,.82);
}
.modal-shell::before {
  content: ""; position: absolute; inset: 1.65cqw 1.35cqw 2.45cqw; z-index: -1;
  border-left: .2cqw solid rgba(10,186,181,.68); border-right: .2cqw solid rgba(10,186,181,.42);
  background: linear-gradient(rgba(10,186,181,.12) .15cqw, transparent .15cqw) 0 9.2cqw / 100% 19.5cqw, linear-gradient(90deg, rgba(10,186,181,.1) .15cqw, transparent .15cqw) 10.5cqw 0 / 25.2cqw 100%;
  pointer-events: none;
}
.modal-shell::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, transparent 0 5.6%, rgba(10,186,181,.34) 5.6% 42%, transparent 42%) 0 8.8% / 100% .14cqw no-repeat, linear-gradient(90deg, transparent 0 57%, rgba(10,186,181,.18) 57% 96%, transparent 96%) 0 90.7% / 100% .14cqw no-repeat;
  pointer-events: none;
}

.decorative-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.decor-cross { position: absolute; color: var(--cyan); font-family: Arial, sans-serif; font-size: 4.7cqw; font-weight: 200; line-height: 1; opacity: .7; }
.decor-cross-top { right: 2.7cqw; top: 18.2cqw; }
.decor-cross-left { left: 10.4cqw; top: 38cqw; }
.decor-cross-bottom { right: 2.9cqw; top: 209cqw; }
.decor-dots { position: absolute; background-image: radial-gradient(circle, rgba(10,186,181,.62) 0 .24cqw, transparent .29cqw); background-size: 1.68cqw 1.68cqw; opacity: .58; }
.decor-dots-top { right: 4.4cqw; top: 31.5cqw; width: 12.8cqw; height: 14.2cqw; }
.decor-dots-bottom { left: 4.4cqw; top: 211.8cqw; width: 20.4cqw; height: 7.6cqw; }

.modal-header { position: absolute; z-index: 8; left: 4.7cqw; right: 5.35cqw; top: 4cqw; height: 16.8cqw; display: flex; align-items: center; justify-content: flex-start; }
.modal-logo { width: 38cqw; max-width: 180px; height: auto; object-fit: contain; }
/* Hard-hide retired top-left close controls (cache / stale HTML safety). */
#closeDialog,
.modal-header .close-button,
.modal-header .icon-button,
.privacy-close-btn,
#privacyCloseModalBtn {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}
.icon-button { display: grid; place-items: center; width: 7.1cqw; height: 7.1cqw; padding: 1.15cqw; border: 0; background: transparent; cursor: pointer; margin: 0; }
.icon-button svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; }
.icon-button:hover, .icon-button:focus-visible { color: var(--cyan); outline: none; }

.stepper { position: absolute; z-index: 7; left: 48.65%; top: 27cqw; width: 35.5cqw; height: 7cqw; transform: translateX(-50%); }
.stepper-line { position: absolute; left: 5.9cqw; right: 5.9cqw; top: 50%; height: .25cqw; background: rgba(224,232,233,.55); transform: translateY(-50%); }
.stepper-line span { display: block; width: 0; height: 100%; background: var(--cyan); transition: width .32s ease; }
.step { position: absolute; top: 0; z-index: 1; display: grid; place-items: center; width: 7cqw; height: 7cqw; border: .22cqw solid rgba(243,248,248,.72); border-radius: 50%; background: #02090b; color: #fff; font-size: 3.2cqw; line-height: 1; transition: all .28s ease; }
.step:first-of-type { left: 0; }
.step:last-of-type { right: 0; }
.step.is-active, .step.is-complete { background: var(--cyan); border-color: var(--cyan); color: #001012; }

.flow-screen { position: absolute; inset: 0; display: none; visibility: hidden; pointer-events: none; text-align: center; animation: screenIn .24s ease both; overflow: hidden; }
.flow-screen.is-active { display: block; visibility: visible; pointer-events: auto; }
.flow-screen[hidden] { display: none !important; visibility: hidden; pointer-events: none; }
@keyframes screenIn { from { opacity: 0; transform: translateY(.8cqw); } to { opacity: 1; transform: none; } }

.eyebrow { position: absolute; left: 0; right: 0; top: 32.5cqw; margin: 0; color: #d1d7d8; font-size: 3.55cqw; line-height: 1; }
.flow-title { position: absolute; left: 3cqw; right: 3cqw; max-width: 100%; margin: 0; color: #f4f5f5; text-transform: uppercase; white-space: nowrap; overflow-wrap: normal; font-family: var(--nanno-font-display); font-weight: 400; letter-spacing: 0; line-height: .92; text-shadow: 0 .35cqw 1cqw rgba(0,0,0,.72); }
.flow-title span { display: inline-block; margin-right: 1.35cqw; color: #f4f5f5; }
.flow-title strong { color: var(--cyan); font-weight: 700; }
.flow-subtitle { position: absolute; left: 4cqw; right: 4cqw; margin: 0; color: #d5dcdd; font-size: 3.65cqw; line-height: 1.48; }

/* Capture Step */
[data-screen="capture"].flow-screen { text-align: center; }
[data-screen="capture"].flow-screen.is-active {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "title"
        "subtitle"
        "status"
        "camera"
        "actions";
    align-content: start;
    justify-items: center;
    gap: clamp(10px, 1.8dvh, 18px);
    padding: clamp(118px, 14dvh, 150px) clamp(16px, 4vw, 36px) clamp(24px, 5dvh, 48px);
    overflow-x: hidden;
    overflow-y: auto;
}
[data-screen="capture"] .flow-title {
    position: relative;
    grid-area: title;
    left: auto;
    right: auto;
    top: auto;
    max-width: 760px;
    font-size: clamp(34px, 10vw, 58px);
    line-height: 1.04;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    text-align: center;
}
[data-screen="capture"] .flow-title strong { display: inline; }
[data-screen="capture"] .flow-title span { margin-right: 0; }
[data-screen="capture"] .flow-subtitle {
    position: relative;
    grid-area: subtitle;
    left: auto;
    right: auto;
    top: auto;
    max-width: 620px;
    padding: 0;
    color: var(--nanno-muted);
    font-size: clamp(14px, 3.4vw, 18px);
    line-height: 1.45;
    text-align: center;
}

.camera-frame {
    position: relative;
    grid-area: camera;
    width: min(100%, 70vw, 34dvh, 520px);
    max-width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    padding: clamp(12px, 2.5vw, 20px);
    isolation: isolate;
    border: 1px solid rgba(10,186,181,.38);
    background: rgba(2,9,12,.84);
    box-shadow: 0 0 0 1px rgba(48,55,57,.42), 0 28px 60px rgba(0,0,0,.4);
}
.camera-frame video, .camera-frame canvas { position: relative; z-index: 10; width: 100%; height: 100%; object-fit: cover; object-position: center center; background: #071012; }
.camera-frame video { transform: scaleX(-1); }
.corner { position: absolute; z-index: 12; width: clamp(28px, 7vw, 44px); height: clamp(28px, 7vw, 44px); border-color: rgba(255,255,255,0.2); border-style: solid; pointer-events: none; }
.corner-tl { left: 0; top: 0; border-width: 2px 0 0 2px; }
.corner-tr { right: 0; top: 0; border-width: 2px 2px 0 0; }
.corner-bl { left: 0; bottom: 0; border-width: 0 0 2px 2px; }
.corner-br { right: 0; bottom: 0; border-width: 0 2px 2px 0; }

.camera-frame[data-guide-state="idle"] .camera-overlay,
.camera-frame[data-guide-state="countdown"] .camera-overlay {
    display: none;
}

.camera-framing-assistant {
    position: absolute;
    inset: clamp(10px, 2.4vw, 18px);
    z-index: 17;
    pointer-events: none;
    color: var(--cyan);
    opacity: 0;
    transform: translateY(8px);
    animation: cameraGuideIn .48s ease forwards;
}
.camera-frame[data-guide-state="countdown"] .camera-framing-assistant { z-index: 19; }
.camera-frame[data-guide-state="captured"] .camera-framing-assistant,
.camera-frame[data-guide-state="uploaded"] .camera-framing-assistant,
.camera-frame[data-guide-state="camera-error"] .camera-framing-assistant,
.camera-frame[data-guide-enabled="false"] .camera-framing-assistant {
    display: none;
}

.camera-guide {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.camera-guide-desktop { display: none; }
.camera-frame[data-guide-mode="desktop"] .camera-guide-mobile { display: none; }
.camera-frame[data-guide-mode="desktop"] .camera-guide-desktop { display: block; }

.camera-guide-silhouette-window {
    position: absolute;
    left: 50%;
    top: 44%;
    width: 92%;
    height: 86%;
    overflow: hidden;
    transform: translate(-50%, -50%);
    opacity: .66;
    mix-blend-mode: screen;
    filter: drop-shadow(0 0 10px rgba(10,186,181,.38));
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 96%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 96%, transparent 100%);
}
.camera-guide-silhouette {
    position: absolute;
    left: 50%;
    top: 0;
    display: block;
    width: auto;
    height: 100%;
    max-width: none;
    transform: translateX(-50%);
    user-select: none;
}
.camera-guide-desktop .camera-guide-silhouette-window {
    top: 48%;
    width: 132%;
    height: 92%;
    opacity: .62;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 94%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 94%, transparent 100%);
}
.camera-guide-desktop .camera-guide-silhouette {
    top: -2%;
    height: 200%;
    /* Keep the original guide's outer contour while removing its inner arm lines. */
    clip-path: polygon(
        0 0,
        100% 0,
        100% 100%,
        80% 100%,
        80% 54%,
        20% 54%,
        20% 100%,
        0 100%
    );
}
.guide-scan {
    position: absolute;
    left: 21%;
    right: 21%;
    top: 31%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.9), rgba(10,186,181,.95), transparent);
    box-shadow: 0 0 10px rgba(10,186,181,.9);
    animation: cameraGuideScan 2.8s ease-in-out infinite;
    display: none;
}
.camera-frame[data-guide-state="countdown"] .guide-scan {
    animation-duration: 1.45s;
}

.camera-guide-instruction {
    position: absolute;
    left: clamp(10px, 3vw, 18px);
    right: clamp(10px, 3vw, 18px);
    bottom: clamp(10px, 3vw, 18px);
    display: grid;
    gap: clamp(4px, 1vw, 7px);
    padding: clamp(8px, 2.2vw, 11px) clamp(11px, 2.8vw, 14px);
    border: 1px solid rgba(10,186,181,.42);
    background: linear-gradient(180deg, rgba(2,12,14,.58), rgba(2,9,12,.76));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.035), 0 16px 28px rgba(0,0,0,.34);
    color: #e9f5f5;
    text-align: left;
}
.camera-guide-kicker {
    color: var(--cyan);
    font-size: clamp(10px, 2.2vw, 12px);
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}
.camera-guide-title {
    color: #fff;
    font-size: clamp(13px, 3.1vw, 16px);
    line-height: 1.06;
}
.camera-guide-hint,
.camera-guide-helper {
    color: rgba(232,240,241,.82);
    font-size: clamp(11px, 2.45vw, 13px);
    line-height: 1.28;
}
.camera-guide-hint {
    color: #fff;
    font-weight: 700;
}
.camera-guide-helper { color: rgba(167,173,176,.86); }
.camera-guide-crop-label {
    justify-self: start;
    margin-top: 2px;
    padding-top: 5px;
    border-top: 1px solid rgba(10,186,181,.28);
    color: var(--cyan);
    font-size: clamp(9px, 2vw, 11px);
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1;
    display: none;
}
.camera-frame[data-guide-mode="desktop"] .camera-guide-instruction {
    width: min(50%, 270px);
    right: auto;
}

@keyframes cameraGuideIn {
    to { opacity: 1; transform: none; }
}
@keyframes cameraGuideScan {
    0%, 100% { transform: translateY(-34px); opacity: .28; }
    50% { transform: translateY(114px); opacity: .95; }
}
@media (max-width: 540px), (max-height: 740px) {
    .camera-guide-instruction {
        gap: 3px;
        padding: 9px 10px;
    }
    .camera-guide-helper {
        display: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .camera-framing-assistant {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .guide-scan {
        animation: none;
        opacity: .72;
    }
}

.camera-overlay { position: absolute; left: clamp(18px, 5vw, 28px); right: clamp(18px, 5vw, 28px); bottom: clamp(18px, 5vw, 28px); min-height: clamp(58px, 12dvh, 78px); display: flex; align-items: center; gap: clamp(10px, 3vw, 16px); padding: clamp(10px, 2.8vw, 14px) clamp(12px, 3.2vw, 16px); color: #e5eaeb; text-align: left; font-size: clamp(12px, 2.8vw, 16px); line-height: 1.35; background: rgba(3,10,13,.9); border: 1px solid rgba(207,227,229,.18); backdrop-filter: blur(4px); z-index: 18; }
.camera-overlay svg { flex: 0 0 clamp(24px, 6vw, 34px); width: clamp(24px, 6vw, 34px); fill: none; stroke: #e2e9ea; stroke-width: 1.35; }

.countdown-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.36); display: none; justify-content: center; align-items: center; z-index: 20; font-size: clamp(40px, 8vh, 80px); font-weight: bold; color: #fff; text-align: center; white-space: pre-line; text-shadow: 0 0 40px var(--cyan); }
.countdown-overlay.is-minimal { background: rgba(0, 0, 0, 0.34); }
.countdown-overlay.is-large { font-size: clamp(56px, 10vh, 104px); background: rgba(0, 4, 6, 0.72); }
.countdown-overlay.is-ring::before { content: ""; position: absolute; width: min(58%, 320px); aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--cyan); box-shadow: 0 0 34px rgba(10, 186, 181, .24); }

.camera-status {
    position: relative;
    grid-area: status;
    left: auto;
    top: auto;
    transform: none;
    z-index: 4;
    max-width: min(100%, 520px);
    color: var(--danger);
    background: rgba(255,125,133,0.1);
    padding: 8px 12px;
    border: 1px solid rgba(255,125,133,.32);
    border-radius: 0;
    display: none;
    font-size: clamp(12px, 2.8vw, 14px);
    line-height: 1.35;
}

.screen-actions {
    position: relative;
    grid-area: actions;
    left: auto;
    right: auto;
    top: auto;
    display: grid;
    gap: clamp(10px, 1.6dvh, 14px);
    width: min(100%, 520px);
}
.primary-button { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 2.4vw, 16px); width: 100%; height: clamp(54px, 7dvh, 68px); padding: 0 clamp(16px, 4vw, 28px); border: 1px solid var(--cyan); border-radius: 0; background: linear-gradient(135deg, var(--cyan), var(--nanno-accent-dark)); color: var(--nanno-button-text, #001012); font-family: var(--nanno-font-body); font-size: clamp(18px, 4.8vw, 24px); font-weight: 700; letter-spacing: 0; cursor: pointer; transition: background .3s ease, color .3s ease, box-shadow .3s ease, transform .12s ease; }
.primary-button svg { width: clamp(22px, 5vw, 30px); height: clamp(22px, 5vw, 30px); fill: none; stroke: currentColor; stroke-width: 1.55; }
.primary-button:hover:not(:disabled), .primary-button:focus-visible:not(:disabled) { background: transparent; color: var(--cyan); box-shadow: 0 0 5cqw rgba(10,186,181,.18); outline: none; }
.primary-button:active:not(:disabled) { transform: translateY(.2cqw); }
.primary-button:disabled { opacity: .55; cursor: wait; border-color: #555; color: #555; }
.secondary-button { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 2.4vw, 16px); width: 100%; min-height: clamp(50px, 6.4dvh, 62px); padding: 0 clamp(16px, 4vw, 28px); border: 1px solid rgba(255,255,255,.32); border-radius: 0; background: rgba(255,255,255,.06); color: #f3f7f7; font-family: var(--nanno-font-body); font-size: clamp(16px, 4vw, 21px); font-weight: 700; cursor: pointer; backdrop-filter: blur(10px); }
.secondary-button svg { width: clamp(20px, 4.6vw, 28px); height: clamp(20px, 4.6vw, 28px); fill: none; stroke: currentColor; stroke-width: 1.55; }
.upload-photo-button { text-transform: none; }
.text-button { border: 0; background: transparent; color: #d5dcde; font-size: clamp(14px, 2.8vw, 18px); cursor: pointer; }
.text-button:hover, .text-button:focus-visible { color: var(--cyan); outline: none; }
.capture-secondary-actions { display: grid; gap: 8px; justify-items: center; }
.secure-processing-note { color: rgba(255,255,255,.48); font-size: clamp(11px, 2.4vw, 13px); line-height: 1.35; }

/* Generating Step */
[data-screen="generating"] .flow-title { top: 39cqw; font-size: 5.6cqw; white-space: normal; line-height: 1.1; }
[data-screen="generating"] .flow-subtitle { top: 55.5cqw; }
.generator-wrap { position: absolute; left: 50%; top: 86.5cqw; width: 45.6cqw; height: 45.6cqw; transform: translateX(-50%); }
.generator-ring { --progress: 0; position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: conic-gradient(from -6deg, var(--cyan) calc(var(--progress) * 1%), rgba(89,126,131,.15) 0); transition: --progress .2s linear; }
.generator-ring::before { content: ""; position: absolute; inset: 2.35cqw; border-radius: 50%; background: #02090b; }
.generator-ring::after { content: ""; position: absolute; inset: .65cqw; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(230,245,247,.34) 0 .6deg, transparent .6deg 3.4deg); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.3cqw), #000 0); mask: radial-gradient(farthest-side, transparent calc(100% - 2.3cqw), #000 0); opacity: .62; }
.generator-core { position: relative; z-index: 2; display: grid; place-items: center; width: 44%; aspect-ratio: 1; }
.generator-core svg { width: 100%; fill: none; stroke: #e7eff0; stroke-width: 2; }
.generator-core svg path:nth-child(2), .generator-core svg circle { stroke: var(--cyan); }
.generation-list { position: absolute; left: 19.2cqw; top: 139.5cqw; width: 64cqw; display: grid; gap: 6.1cqw; text-align: left; }
.generation-item { display: flex; align-items: center; gap: 3cqw; color: #dce2e3; font-size: 3.8cqw; line-height: 1; }
.task-icon { flex: 0 0 5.65cqw; display: grid; place-items: center; width: 5.65cqw; height: 5.65cqw; border: .42cqw solid rgba(10,186,181,.72); border-radius: 50%; }
.generation-item.is-running .task-icon { border-top-color: transparent; animation: spin 1s linear infinite; }
.generation-item.is-complete .task-icon { background: var(--cyan); color: #001012; }
.generation-item.is-complete .task-icon::after { content: "✓"; font-size: 3.4cqw; font-weight: 700; }
.privacy-note { position: absolute; left: 9cqw; right: 9cqw; top: 181cqw; display: flex; align-items: center; justify-content: center; gap: 3.8cqw; color: #d2d8da; font-size: 3.55cqw; line-height: 1.45; }
.privacy-note svg { width: 5.4cqw; fill: none; stroke: #d2d8da; stroke-width: 1.45; }

/* ========================================================
   ADJUSTED RESULTS STEP - REPOSITIONED WITHOUT EYEBROWS
   ======================================================== */
.results-screen .eyebrow { top: 30cqw; }
.results-screen .flow-title { top: 34.5cqw; font-size: 5.3cqw; white-space: normal; line-height: 1.1; }
.results-screen .flow-subtitle { top: 47cqw; font-size: 3.2cqw; padding: 0 3cqw; }
.result-grid { position: absolute; left: 5.3cqw; top: 53.5cqw; width: 86.7cqw; height: 38.8cqw; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.75cqw; }
.result-card { position: relative; height: 100%; border: .2cqw solid var(--nanno-border); cursor: pointer; overflow: hidden; background: #071113; display: flex; flex-direction: column; transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease; }

.result-card-img-wrapper { position: relative; width: 100%; flex: 1; overflow: hidden; }
.result-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.result-card:hover { border-color: rgba(10,186,181,.68); transform: translateY(-.35cqw); }
.result-card:hover img { transform: scale(1.03); filter: brightness(1.08); }
.result-card input { position: absolute; opacity: 0; pointer-events: none; }
.selection-mark { position: absolute; right: 0; top: 0; display: none; place-items: center; width: 7.1cqw; height: 7.1cqw; background: rgba(0,8,10,.94); border-left: .2cqw solid var(--cyan); border-bottom: .2cqw solid var(--cyan); color: var(--cyan); font-size: 4.4cqw; font-weight: 700; z-index: 10; }
.result-card.is-selected { box-shadow: inset 0 0 0 .12cqw var(--cyan); }
.result-card.is-selected .selection-mark { display: grid; }

.result-caption { padding: 1.2cqw 0.5cqw; background: rgba(5,5,5,.88); color: #fff; font-family: var(--nanno-font-body); font-size: 2.1cqw; font-weight: 700; text-align: center; text-transform: none; letter-spacing: 0; line-height: 1.2; display: grid; place-items: center; border-top: .2cqw solid rgba(10,186,181,.46); min-height: 6cqw; z-index: 10; }

.section-divider { position: absolute; left: 6.6cqw; right: 9cqw; top: 96.5cqw; display: flex; align-items: center; gap: 3.1cqw; color: var(--cyan); font-size: 3.4cqw; font-weight: 700; letter-spacing: .13cqw; line-height: 1; }
.section-divider::before, .section-divider::after { content: ""; flex: 1; height: .22cqw; background: rgba(10,186,181,.68); }

.results-screen form { position: absolute; left: 6.55cqw; right: 9cqw; top: 102.5cqw; height: 105cqw; }
.field-group { position: absolute; left: 0; right: 0; height: 18cqw; text-align: left; }
.field-group:nth-child(1) { top: 0; }
.field-group:nth-child(2) { top: 17.5cqw; }
.field-group:nth-child(3) { top: 35cqw; }
.field-group label { display: block; height: 5.4cqw; margin: 0; color: #e3e8e9; font-size: 3.55cqw; line-height: 1; }
.field-group sup { color: #fff; }
.field-group input { width: 100%; height: 9.45cqw; padding: 0 3.7cqw; border: .2cqw solid rgba(135,162,167,.58); border-radius: 0; background: rgba(2,9,12,.74); color: #fff; font-size: 3.45cqw; outline: none; }
.field-group input::placeholder { color: #9ca7aa; opacity: 1; }
.field-group input:focus { border-color: var(--cyan); box-shadow: 0 0 0 .35cqw rgba(10,186,181,.11); }

.terms-row { position: absolute; left: 0; right: 0; display: flex; align-items: flex-start; gap: 2.4cqw; color: #dbe1e2; text-align: left; line-height: 1.25; cursor: pointer; white-space: normal; padding-right: 2cqw; }
.terms-row.terms-1 { top: 54cqw; }
.terms-row.terms-2 { top: 70cqw; }
.terms-row input { position: absolute; opacity: 0; }
.custom-checkbox { display: grid; place-items: center; flex: 0 0 5.8cqw; width: 5.8cqw; height: 5.8cqw; border: .22cqw solid var(--cyan); color: transparent; font-size: 4cqw; margin-top: 0.2cqw; }
.terms-row input:checked + .custom-checkbox { color: var(--cyan); }

.results-screen form > .primary-button { position: absolute; left: 0; right: 0; top: 83cqw; height: 13.5cqw; font-size: 4.75cqw; }
.results-screen form > .primary-button svg { width: 6.4cqw; height: 6.4cqw; }
.back-button { position: absolute; left: 0; right: 0; top: 213.5cqw; margin: 0; font-size: 3.45cqw; }

.success-toast { position: absolute; left: 50%; bottom: 5.5cqw; z-index: 20; display: grid; gap: .8cqw; width: 84cqw; padding: 3.2cqw 3.8cqw; border: .22cqw solid var(--cyan); background: rgba(2,12,14,.97); color: #e9f3f4; text-align: left; transform: translate(-50%,145%); opacity: 0; transition: transform .28s ease, opacity .28s ease; pointer-events:none; }
.success-toast.is-visible { transform: translate(-50%,0); opacity: 1; pointer-events:auto; }
.success-toast strong { color: var(--cyan); text-transform: uppercase; letter-spacing: .12cqw; font-size: 3.4cqw; }
.success-toast span { color: #d3dcde; font-size: 2.8cqw; }

/* ========================================================
   5. PRIVACY MODAL
   ======================================================== */
.privacy-modal { margin: auto; border: none; z-index: 10000; }
.privacy-modal::backdrop { background: rgba(0, 0, 0, 0.88); backdrop-filter: blur(12px); }

.privacy-modal {
    width: min(1120px, calc(100vw - clamp(24px, 4vw, 64px)));
    max-width: none;
    height: min(900px, calc(100dvh - clamp(24px, 4dvh, 64px)));
    max-height: none;
    background: #050505;
    border: 1px solid var(--nanno-border);
    border-radius: 0;
    padding: 0;
    overflow: hidden;
    z-index: 10005;
}
.privacy-modal[open] { display: block; }
.privacy-content-wrapper { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.privacy-iframe { display: block; width: 100%; height: 100%; border: none; border-radius: 0; }
.privacy-close-btn {
    position: absolute !important;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    left: auto !important;
    transform: none !important;
    background: rgba(0,0,0,0.72) !important;
    border: 1px solid var(--cyan) !important;
    color: var(--white, #fff) !important;
    font-size: 26px;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 !important;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}
.privacy-close-btn:hover { background: var(--cyan) !important; color: #000 !important; transform: none !important; }

@keyframes spin { to { transform: rotate(360deg); } }

.capture-secondary-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; align-items: center; }
.capture-secondary-actions .text-button { margin-top: 0; }
.secure-processing-note { color: #879294; font-size: clamp(12px, 2.8vw, 14px); line-height: 1.4; margin: 0; max-width: 360px; }
.inline-privacy-link { color: var(--cyan); text-decoration: underline; }
.success-close-button { height: auto; padding: 1cqw; margin-top: 2cqw; font-size: 3.5cqw; }
.button-spinner { display: inline-block; width: 5cqw; height: 5cqw; border: .2cqw solid var(--cyan); border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 2cqw; }
.empty-state { text-align: center; color: #ff6b6b; font-size: clamp(14px, 3vw, 28px); grid-column: 1 / -1; }

/* Quiz During Generation */
[data-screen="generating"].flow-screen.is-active {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    align-content: stretch;
    gap: clamp(10px, 1.6dvh, 18px);
    padding: clamp(112px, 13dvh, 148px) clamp(16px, 4vw, 44px) clamp(24px, 4dvh, 42px);
    overflow-x: hidden;
    overflow-y: auto;
}

[data-screen="generating"] .flow-title,
[data-screen="generating"] .flow-subtitle {
    position: relative;
    inset: auto;
    left: auto;
    right: auto;
    top: auto;
    margin: 0 auto;
    max-width: min(100%, 900px);
    text-align: center;
}

[data-screen="generating"] .flow-title {
    font-size: clamp(32px, 6vw, 62px);
}

[data-screen="generating"] .flow-subtitle {
    font-size: clamp(13px, 2.6vw, 18px);
}

.generating-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(220px, .82fr);
    align-items: stretch;
    gap: clamp(14px, 2.2vw, 28px);
    width: min(100%, 1420px);
    min-height: 0;
    margin: 0 auto;
}

.generation-status-panel,
.quiz-panel {
    min-width: 0;
    border: 1px solid rgba(48,55,57,.86);
    background: linear-gradient(180deg, rgba(2,11,13,.86), rgba(5,5,5,.76));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.035), 0 28px 54px rgba(0,0,0,.28);
}

.generation-status-panel {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: clamp(16px, 2.2dvh, 26px);
    padding: clamp(16px, 3vw, 28px);
}

.generation-status-panel .generator-wrap,
.generation-status-panel .generation-list,
.generation-status-panel .privacy-note {
    position: relative;
    inset: auto;
    left: auto;
    right: auto;
    top: auto;
    width: 100%;
    transform: none;
}

.generation-status-panel .generator-wrap {
    width: clamp(150px, 28cqw, 230px);
    height: auto;
    aspect-ratio: 1;
}

.generation-status-panel .generation-list {
    display: grid;
    gap: clamp(10px, 1.6dvh, 14px);
}

.generation-status-panel .generation-item {
    gap: 12px;
    font-size: clamp(13px, 2.5vw, 16px);
    line-height: 1.25;
}

.generation-status-panel .task-icon {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.generation-status-panel .generation-item.is-complete .task-icon::after {
    font-size: 16px;
}

.generation-status-panel .privacy-note {
    display: flex;
    gap: 12px;
    font-size: clamp(12px, 2.2vw, 14px);
    line-height: 1.35;
}

.generation-status-panel .privacy-note svg {
    width: 22px;
    flex: 0 0 22px;
}

.generation-ready-message {
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border-left: 3px solid var(--cyan);
    background: rgba(10,186,181,.1);
    color: #e9ffff;
    font: 700 clamp(12px, 2.2vw, 14px)/1.35 var(--nanno-font-body);
    text-align: left;
}

.quiz-panel {
    display: grid;
    gap: clamp(10px, 1.4dvh, 16px);
    align-content: start;
    padding: clamp(16px, 3vw, 30px);
    text-align: left;
    font-family: var(--nanno-font-body);
}

.quiz-panel[hidden] {
    display: none !important;
}

.quiz-kicker {
    margin: 0;
    color: var(--cyan);
    font-size: clamp(10px, 1.4vw, 12px);
    font-weight: 700;
    letter-spacing: .08em;
}

.quiz-title {
    margin: 0;
    color: #fff;
    font: 700 clamp(20px, 3.2vw, 30px)/1.05 var(--nanno-font-body);
}

.quiz-subtitle,
.quiz-privacy-note,
.quiz-status {
    margin: 0;
    color: rgba(232,240,241,.78);
    font-size: clamp(12px, 2.2vw, 14px);
    line-height: 1.42;
}

.quiz-status {
    display: block;
    padding: 10px 12px;
    border-left: 3px solid var(--cyan);
    background: rgba(10,186,181,.1);
    color: #e9ffff;
}

.quiz-status:empty,
.quiz-status[hidden] {
    display: none;
}

.quiz-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255,255,255,.82);
    font-size: clamp(11px, 1.9vw, 13px);
}

.quiz-progress-bar {
    height: 4px;
    background: rgba(255,255,255,.14);
    overflow: hidden;
}

.quiz-progress-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--cyan);
    transition: width .3s ease;
}

.quiz-question {
    display: grid;
    gap: 6px;
    min-height: 78px;
    animation: quizFadeIn .42s ease both;
}

.quiz-question strong {
    color: #fff;
    font-size: clamp(18px, 3vw, 24px);
    line-height: 1.18;
}

.quiz-question span {
    color: rgba(232,240,241,.68);
    font-size: clamp(12px, 2.1vw, 14px);
}

.quiz-complete-label {
    color: var(--cyan) !important;
    font-size: clamp(11px, 1.8vw, 13px) !important;
    font-weight: 700;
    text-transform: uppercase;
}

.quiz-options {
    display: grid;
    gap: clamp(8px, 1.2dvh, 12px);
}

.quiz-option {
    width: 100%;
    padding: clamp(12px, 2.1vw, 16px);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 0;
    background: rgba(255,255,255,.045);
    color: #f5fafa;
    font: 700 clamp(13px, 2.2vw, 16px)/1.24 var(--nanno-font-body);
    text-align: left;
    cursor: pointer;
    transition: transform .18s ease, border-color .24s ease, background .24s ease;
}

.quiz-option:hover,
.quiz-option:focus-visible {
    border-color: rgba(10,186,181,.7);
    background: linear-gradient(90deg, rgba(10,186,181,.14), rgba(255,255,255,.04));
    outline: none;
    transform: translateY(-1px);
}

.quiz-option.is-selected,
.quiz-option[aria-pressed="true"] {
    border-color: var(--cyan);
    background: rgba(10,186,181,.2);
    color: #fff;
}

.quiz-controls {
    display: flex;
    justify-content: flex-start;
}

.quiz-nav-button {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 0;
    background: transparent;
    color: rgba(255,255,255,.86);
    font: 700 13px/1 var(--nanno-font-body);
    cursor: pointer;
}

.quiz-nav-button:disabled {
    opacity: .42;
    cursor: not-allowed;
}

.quiz-nav-button:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

@keyframes quizFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 900px), (orientation: portrait) {
    .generating-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .generation-status-panel {
        order: 1;
        grid-template-columns: auto minmax(0, 1fr);
        justify-items: start;
        align-items: center;
    }

    .generation-status-panel .generator-wrap {
        width: clamp(88px, 24vw, 128px);
    }

    .generation-status-panel .generation-list {
        gap: 8px;
    }

    .generation-status-panel .privacy-note {
        grid-column: 1 / -1;
    }

    .quiz-panel {
        order: 2;
    }
}

@media (prefers-reduced-motion: reduce) {
    .quiz-question {
        animation: none;
    }

    .quiz-option,
    .quiz-progress-bar span {
        transition: none;
    }

    .portrait-lightbox-shell,
    .portrait-lightbox-figure img {
        animation: none;
        transition: none;
    }
}

/* Full-page portrait preview lightbox (Result Review) */
.portrait-lightbox {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(5, 5, 5, 0.94);
    color: #fff;
}

.portrait-lightbox::backdrop {
    background: rgba(5, 5, 5, 0.92);
}

.portrait-lightbox-shell {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: clamp(12px, 2vh, 24px);
    padding:
        max(16px, env(safe-area-inset-top))
        max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));
    background:
        linear-gradient(180deg, rgba(10, 186, 181, 0.08), transparent 28%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
        #050505;
    border: 1px solid var(--nanno-border, #303739);
}

.portrait-lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 48px;
}

.portrait-lightbox-kicker {
    margin: 0;
    color: var(--cyan, #0ABAB5);
    font-family: var(--nanno-font-body, "Space Grotesk", sans-serif);
    font-size: clamp(14px, 1.4vw, 18px);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portrait-lightbox-close {
    flex: 0 0 auto;
    min-width: 120px;
}

.portrait-lightbox-figure {
    margin: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 12px;
    border: 1px solid rgba(10, 186, 181, 0.35);
    background: #071113;
    overflow: hidden;
}

.portrait-lightbox-figure img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
    background: #050505;
}

.portrait-lightbox-figure figcaption {
    margin: 0;
    padding: 12px 16px;
    border-top: 1px solid rgba(10, 186, 181, 0.35);
    background: rgba(5, 5, 5, 0.92);
    color: #fff;
    font-family: var(--nanno-font-body, "Space Grotesk", sans-serif);
    font-size: clamp(14px, 1.5vw, 20px);
    font-weight: 700;
    text-align: center;
}
