:root {
    --ink: #172033;
    --ink-soft: #344054;
    --muted: #667085;
    --canvas: #f7f3ed;
    --paper: #fffdf9;
    --white: #ffffff;
    --coral: #f76f52;
    --coral-dark: #df573d;
    --coral-soft: #fff0eb;
    --violet: #7c5cff;
    --violet-soft: #f0edff;
    --mint: #22a884;
    --mint-soft: #e9f8f3;
    --amber: #f3a83b;
    --danger: #d92d20;
    --danger-soft: #fff1f0;
    --line: #e7e1d8;
    --line-strong: #d6cec2;
    --shadow-sm: 0 8px 24px rgba(23, 32, 51, 0.07);
    --shadow-lg: 0 28px 80px rgba(23, 32, 51, 0.12);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --max-width: 1180px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: "Segoe UI Variable", "Aptos", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    content: "";
    pointer-events: none;
    opacity: 0.42;
    background-image: radial-gradient(rgba(23, 32, 51, 0.055) 0.7px, transparent 0.7px);
    background-size: 7px 7px;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1,
h2,
h3,
h4,
.brand {
    font-family: "Segoe UI Variable Display", "Aptos Display", ui-sans-serif, system-ui, sans-serif;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

svg {
    display: block;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

[hidden] {
    display: none !important;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 12px;
    left: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    color: var(--white);
    background: var(--ink);
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 180ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(calc(100% - 40px), var(--max-width));
    margin: 0 auto;
    padding: 24px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px 11px 11px 4px;
    overflow: hidden;
    background: var(--ink);
    box-shadow: 0 8px 18px rgba(23, 32, 51, 0.2);
}

.brand-mark svg {
    width: 100%;
    height: 100%;
}

.brand-mark .mark-back {
    fill: var(--violet);
}

.brand-mark .mark-front {
    fill: none;
    stroke: var(--coral);
    stroke-width: 5;
    stroke-linejoin: round;
}

.brand-mark circle {
    fill: #7ce3c5;
}

.brand-mark.small {
    width: 34px;
    height: 34px;
    border-radius: 10px 10px 10px 4px;
    font-size: 1rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.site-nav a,
.text-link {
    color: var(--ink-soft);
    font-size: 0.93rem;
    font-weight: 600;
    text-decoration: none;
}

.site-nav a {
    position: relative;
}

.site-nav a::after {
    position: absolute;
    right: 0;
    bottom: -5px;
    left: 0;
    height: 2px;
    content: "";
    background: var(--coral);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 180ms ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-cta {
    padding: 10px 17px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.nav-cta:hover {
    color: var(--white);
    background: var(--ink);
    transform: translateY(-2px);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.03fr) minmax(420px, 0.97fr);
    gap: 72px;
    align-items: center;
    width: min(calc(100% - 40px), var(--max-width));
    min-height: 650px;
    margin: 0 auto;
    padding: 72px 0 96px;
}

.eyebrow,
.section-kicker {
    color: var(--coral-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 21px;
}

.eyebrow span {
    width: 20px;
    height: 2px;
    background: var(--coral);
}

.hero h1 {
    max-width: 680px;
    margin-bottom: 25px;
    font-size: clamp(3.6rem, 7vw, 6.25rem);
    line-height: 0.98;
    letter-spacing: -0.065em;
}

.hero h1 em {
    position: relative;
    color: var(--coral);
    font-style: normal;
}

.hero h1 em::after {
    position: absolute;
    right: 0;
    bottom: -9px;
    left: 4px;
    height: 11px;
    content: "";
    opacity: 0.75;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='12' viewBox='0 0 420 12'%3E%3Cpath d='M3 8C105 2 302 2 417 7' stroke='%23f76f52' stroke-width='5' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.hero-lead {
    max-width: 610px;
    margin-bottom: 33px;
    color: var(--muted);
    font-size: 1.13rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 32px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 20px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.button-primary {
    color: var(--white);
    background: var(--coral);
    box-shadow: 0 12px 28px rgba(247, 111, 82, 0.28);
}

.button-primary:not(:disabled):hover {
    background: var(--coral-dark);
    box-shadow: 0 15px 32px rgba(247, 111, 82, 0.33);
    transform: translateY(-2px);
}

.button-secondary {
    color: var(--ink);
    border: 1px solid var(--line-strong);
    background: var(--white);
}

.button-secondary:not(:disabled):hover {
    border-color: var(--ink);
    transform: translateY(-2px);
}

.button:disabled {
    color: #98a2b3;
    background: #e8e8e5;
    box-shadow: none;
    cursor: not-allowed;
}

.text-link {
    border-bottom: 1px solid var(--ink);
}

.trust-list {
    display: flex;
    flex-wrap: wrap;
    gap: 11px 22px;
    margin: 0;
    padding: 0;
    color: var(--ink-soft);
    list-style: none;
    font-size: 0.86rem;
    font-weight: 600;
}

.trust-list li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.trust-list svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--mint);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero-showcase {
    position: relative;
    min-height: 510px;
    border-radius: 48% 52% 44% 56% / 50% 45% 55% 50%;
    background: #eee8de;
}

.showcase-orbit {
    position: absolute;
    border: 1px solid rgba(23, 32, 51, 0.12);
    border-radius: 50%;
}

.orbit-one {
    inset: 42px 32px;
    transform: rotate(17deg);
}

.orbit-two {
    inset: 82px 64px;
    transform: rotate(-20deg);
}

.showcase-card {
    position: absolute;
    overflow: hidden;
    width: 265px;
    aspect-ratio: 4 / 5;
    border: 8px solid var(--white);
    border-radius: 16px;
    background: #c7c1b7;
    box-shadow: var(--shadow-lg);
}

.showcase-back {
    top: 48px;
    left: 40px;
    transform: rotate(-9deg);
}

.showcase-front {
    right: 27px;
    bottom: 35px;
    transform: rotate(7deg);
}

.mock-photo {
    position: absolute;
    inset: 0;
}

.mock-photo::before,
.mock-photo::after {
    position: absolute;
    content: "";
    border-radius: 50%;
}

.mock-photo-one {
    background: linear-gradient(155deg, #f6caa9 0 46%, #496e63 46% 67%, #253f3d 67%);
}

.mock-photo-one::before {
    top: 76px;
    left: 80px;
    width: 100px;
    height: 165px;
    border-radius: 55px 55px 30px 30px;
    background: #e9a77d;
    box-shadow: -54px 55px 0 -15px #e6ba91, 60px 50px 0 -19px #9c604a;
}

.mock-photo-two {
    background: linear-gradient(145deg, #9c8edb 0 45%, #f0b887 45% 70%, #b24e56 70%);
}

.mock-photo-two::before {
    top: 70px;
    left: 72px;
    width: 112px;
    height: 175px;
    border-radius: 60px 60px 35px 35px;
    background: #efb48c;
    box-shadow: -60px 60px 0 -18px #694239, 67px 52px 0 -22px #d89572;
}

.mock-frame {
    position: absolute;
    z-index: 1;
    inset: 13px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
    border: 3px solid rgba(255, 255, 255, 0.95);
    color: var(--white);
    font-family: "Segoe UI Variable Display", "Aptos Display", ui-sans-serif, sans-serif;
    line-height: 1.03;
    letter-spacing: 0.08em;
}

.mock-frame span {
    font-size: 1rem;
    font-weight: 800;
}

.mock-frame small {
    align-self: flex-end;
    font-size: 0.55rem;
    font-weight: 800;
}

.floating-pill {
    position: absolute;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid rgba(23, 32, 51, 0.08);
    border-radius: 999px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.93);
    box-shadow: var(--shadow-sm);
    font-size: 0.78rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.floating-pill svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--mint);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pill-privacy {
    top: 36px;
    right: 4px;
}

.pill-count {
    bottom: 25px;
    left: 0;
    color: var(--violet);
}

.how-section {
    padding: 98px max(20px, calc((100% - var(--max-width)) / 2));
    background: var(--ink);
}

.section-heading {
    max-width: 680px;
    margin: 0 auto 50px;
    text-align: center;
}

.section-heading h2,
.workspace-heading h2,
.privacy-copy h2 {
    margin-bottom: 15px;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.1;
    letter-spacing: -0.045em;
}

.section-heading h2 {
    color: var(--white);
}

.section-heading > p:last-child {
    color: #aeb6c5;
}

.how-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.how-card {
    position: relative;
    min-height: 290px;
    padding: 31px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--white);
    background: rgba(255, 255, 255, 0.045);
}

.how-card.featured {
    background: rgba(124, 92, 255, 0.12);
    transform: translateY(-12px);
}

.step-number {
    position: absolute;
    top: 25px;
    right: 27px;
    color: rgba(255, 255, 255, 0.19);
    font-family: "Segoe UI Variable Display", "Aptos Display", ui-sans-serif, sans-serif;
    font-size: 2.1rem;
    font-weight: 800;
}

.how-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 47px;
    border-radius: 15px;
}

.how-icon.coral { background: rgba(247, 111, 82, 0.18); color: #ff9a83; }
.how-icon.violet { background: rgba(124, 92, 255, 0.21); color: #ac9aff; }
.how-icon.mint { background: rgba(34, 168, 132, 0.18); color: #6fdfbd; }

.how-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.how-card h3 {
    margin-bottom: 9px;
    font-size: 1.2rem;
}

.how-card p {
    margin-bottom: 0;
    color: #aeb6c5;
    font-size: 0.93rem;
}

.workspace-shell {
    width: min(calc(100% - 40px), var(--max-width));
    margin: 0 auto;
    padding: 105px 0 110px;
    scroll-margin-top: 20px;
}

.workspace-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 34px;
}

.workspace-heading h2 {
    margin-bottom: 9px;
}

.workspace-heading > div > p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.section-kicker {
    margin-bottom: 12px;
}

.section-kicker.light {
    color: #ff9a83;
}

.privacy-chip {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    padding: 9px 13px;
    border: 1px solid #bde5d9;
    border-radius: 999px;
    color: #14795f;
    background: var(--mint-soft);
    font-size: 0.82rem;
    font-weight: 700;
}

.privacy-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 4px rgba(34, 168, 132, 0.12);
}

.workspace-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 0;
    padding: 0 22px 27px;
    list-style: none;
}

.workspace-steps li {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #98a2b3;
}

.workspace-steps li:not(:last-child)::after {
    position: absolute;
    z-index: -1;
    top: 18px;
    left: 44px;
    width: calc(100% - 52px);
    height: 1px;
    content: "";
    background: var(--line-strong);
}

.workspace-steps li > span {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--canvas);
    font-size: 0.8rem;
    font-weight: 800;
}

.workspace-steps li.is-active {
    color: var(--ink);
}

.workspace-steps li.is-active > span {
    color: var(--white);
    border-color: var(--coral);
    background: var(--coral);
}

.workspace-steps li.is-complete {
    color: var(--ink-soft);
}

.workspace-steps li.is-complete > span {
    color: var(--white);
    border-color: var(--mint);
    background: var(--mint);
}

.workspace-steps li.is-complete:not(:last-child)::after {
    background: var(--mint);
}

.workspace-steps strong,
.workspace-steps small {
    display: block;
}

.workspace-steps strong {
    font-size: 0.83rem;
}

.workspace-steps small {
    font-size: 0.69rem;
}

.tool-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    box-shadow: var(--shadow-lg);
}

.tool-section {
    padding: 42px 48px;
}

.tool-section-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.tool-section-heading h3,
.gallery-heading h3 {
    margin-bottom: 2px;
    font-size: 1.1rem;
}

.tool-section-heading p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.tool-section-number {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 35px;
    height: 35px;
    border-radius: 10px;
    color: var(--coral-dark);
    background: var(--coral-soft);
    font-family: "Segoe UI Variable Display", "Aptos Display", ui-sans-serif, sans-serif;
    font-size: 0.84rem;
    font-weight: 800;
}

.violet-number { color: var(--violet); background: var(--violet-soft); }
.mint-number { color: var(--mint); background: var(--mint-soft); }

.upload-zone {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 17px;
    align-items: center;
    padding: 22px 24px;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius-md);
    background: #fbfaf7;
    cursor: pointer;
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.photo-upload-zone {
    display: grid !important;
    min-height: 118px;
    visibility: visible !important;
    opacity: 1 !important;
}

.upload-zone:hover:not(.locked),
.upload-zone.dragover {
    border-color: var(--coral);
    background: var(--coral-soft);
    box-shadow: 0 10px 30px rgba(247, 111, 82, 0.09);
    transform: translateY(-2px);
}

.photo-upload-zone:hover:not(.locked),
.photo-upload-zone.dragover {
    border-color: var(--violet);
    background: var(--violet-soft);
    box-shadow: 0 10px 30px rgba(124, 92, 255, 0.09);
}

.upload-zone.locked {
    border-color: #ddd6cc;
    color: var(--ink-soft);
    background: #f8f6f1;
    cursor: not-allowed;
}

.upload-zone.locked .upload-icon,
.upload-zone.locked .upload-copy,
.upload-zone.locked .browse-label {
    opacity: 0.68;
}

.upload-zone.locked .browse-label {
    background: #fdfbf8;
}

.upload-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
}

.upload-icon svg,
.template-placeholder svg,
.export-icon svg,
.shield-ring svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.upload-icon svg {
    width: 24px;
    height: 24px;
}

.coral-icon { color: var(--coral-dark); background: var(--coral-soft); }
.violet-icon { color: var(--violet); background: var(--violet-soft); }

.upload-copy h4 {
    margin-bottom: 2px;
    font-size: 0.96rem;
}

.upload-copy p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.browse-label {
    padding: 8px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--white);
    font-size: 0.78rem;
    font-weight: 700;
}

.upload-status {
    min-height: 24px;
    margin: 10px 3px 0;
    color: var(--muted);
    font-size: 0.79rem;
}

.upload-status.is-error,
.main-status.is-error {
    color: var(--danger);
}

.upload-status.is-warning,
.main-status.is-warning {
    color: #a15c00;
}

.template-manager {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.template-card {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    min-height: 155px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--white);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.template-card:not(.is-empty) {
    border-color: #bde5d9;
    box-shadow: 0 8px 24px rgba(34, 168, 132, 0.08);
}

.template-preview-wrap {
    position: relative;
    display: grid;
    place-items: center;
    width: 132px;
    height: 98px;
    overflow: hidden;
    border-radius: 11px;
    background-color: #eeebe5;
    background-image:
        linear-gradient(45deg, #ddd8cf 25%, transparent 25%),
        linear-gradient(-45deg, #ddd8cf 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ddd8cf 75%),
        linear-gradient(-45deg, transparent 75%, #ddd8cf 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.template-preview-wrap.portrait-preview {
    width: 76px;
    height: 116px;
    margin-inline: auto;
}

.template-preview-wrap img {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.template-card:not(.is-empty) .template-preview-wrap img {
    display: block;
}

.template-card:not(.is-empty) .template-placeholder {
    display: none;
}

.template-placeholder {
    color: #938b7f;
}

.template-placeholder svg {
    width: 28px;
    height: 28px;
}

.template-card-content {
    min-width: 0;
}

.orientation-label {
    display: block;
    margin-bottom: 2px;
    color: var(--violet);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.template-card h4 {
    margin-bottom: 3px;
    font-size: 0.92rem;
}

.template-card p {
    min-height: 32px;
    margin-bottom: 8px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.72rem;
    overflow-wrap: anywhere;
}

.template-card-actions {
    display: flex;
    gap: 7px;
}

.template-action {
    padding: 5px 9px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    color: var(--ink-soft);
    background: var(--white);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
}

.template-action:hover:not(:disabled) {
    border-color: var(--ink);
}

.template-action.danger:not(:disabled) {
    color: var(--danger);
    border-color: #f3c4bf;
    background: var(--danger-soft);
}

.template-action:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.panel-divider {
    height: 1px;
    margin: 0 48px;
    background: var(--line);
}

.main-status {
    min-height: 25px;
    margin: 2px 48px 0;
    color: var(--ink-soft);
    font-size: 0.86rem;
    font-weight: 600;
    text-align: center;
}

progress {
    display: block;
    width: calc(100% - 96px);
    height: 8px;
    margin: 10px 48px 0;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    appearance: none;
}

progress::-webkit-progress-bar {
    border-radius: 999px;
    background: #ede9e3;
}

progress::-webkit-progress-value {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--coral), var(--violet));
}

progress::-moz-progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--coral), var(--violet));
}

.preview-container {
    padding: 0 48px 36px;
}

.gallery-heading > div {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.gallery-heading h3 {
    margin: 0;
}

.gallery-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8f6f1;
}

.select-all-control {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
}

.select-all-control input,
.photo-select input {
    width: 16px;
    height: 16px;
    accent-color: var(--violet);
}

.selection-count {
    color: var(--muted);
    font-size: 0.72rem;
}

.toolbar-spacer {
    flex: 1;
}

.compact-field {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.compact-field select,
.export-field select,
.export-field input[type="text"] {
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--ink);
    background: var(--white);
    outline: none;
}

.compact-field select,
.export-field select {
    padding-right: 40px;
    background-color: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    appearance: none;
    -webkit-appearance: none;
}

.compact-field select:hover:not(:disabled),
.export-field select:hover:not(:disabled),
.export-field input[type="text"]:hover:not(:disabled) {
    border-color: #b8aea0;
}

.compact-field select:focus-visible,
.export-field select:focus-visible,
.export-field input[type="text"]:focus-visible {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.13);
}

.toolbar-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--ink-soft);
    background: var(--white);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
}

.toolbar-button svg,
.photo-action svg,
.icon-button svg,
.editor-button-row svg,
.editor-stage p svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.toolbar-button:hover:not(:disabled) {
    border-color: var(--ink);
}

.toolbar-button.danger:not(:disabled) {
    color: var(--danger);
}

.toolbar-button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

#preview-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 15px;
}

.preview-item {
    position: relative;
    width: 100%;
    margin: 0;
    overflow: hidden;
    border: 4px solid var(--white);
    border-radius: 14px;
    background: #eae5de;
    box-shadow: var(--shadow-sm);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.preview-item.is-missing-template {
    border-color: #f6c66f;
}

.preview-item.is-selected {
    border-color: var(--violet);
    box-shadow: 0 10px 28px rgba(124, 92, 255, 0.2);
}

.preview-item:hover {
    transform: translateY(-2px);
}

.preview-item canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.preview-item img.source-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item img.overlay-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.preview-warning {
    position: absolute;
    right: 8px;
    bottom: 52px;
    left: 8px;
    padding: 6px 8px;
    border-radius: 7px;
    color: var(--white);
    background: rgba(135, 74, 0, 0.92);
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
}

.orientation-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--white);
    background: rgba(23, 32, 51, 0.82);
    font-size: 0.66rem;
    font-weight: 700;
    backdrop-filter: blur(5px);
}

.photo-select {
    position: absolute;
    z-index: 3;
    top: 9px;
    left: 9px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 3px 10px rgba(23, 32, 51, 0.15);
    cursor: pointer;
}

.photo-select input {
    margin: 0;
}

.photo-card-footer {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 48px;
    padding: 8px 9px 8px 11px;
    color: var(--white);
    background: linear-gradient(180deg, transparent, rgba(14, 20, 32, 0.9) 42%);
}

.photo-card-name {
    min-width: 0;
    overflow: hidden;
    font-size: 0.68rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-card-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 5px;
}

.photo-action {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: var(--white);
    background: rgba(255, 255, 255, 0.13);
    cursor: pointer;
    backdrop-filter: blur(5px);
}

.photo-action:hover {
    background: rgba(255, 255, 255, 0.27);
}

.export-bar {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
    padding: 25px 48px;
    border-top: 1px solid var(--line);
    background: #f8f6f1;
}

.export-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.export-copy {
    display: flex;
    align-items: center;
    gap: 13px;
}

.export-copy strong,
.export-copy small {
    display: block;
}

.export-copy strong {
    font-family: "Segoe UI Variable Display", "Aptos Display", ui-sans-serif, sans-serif;
    font-size: 0.9rem;
}

.export-copy small {
    color: var(--muted);
    font-size: 0.72rem;
}

.export-icon {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    border-radius: 11px;
    color: var(--mint);
    background: var(--mint-soft);
}

.export-icon svg {
    width: 21px;
    height: 21px;
}

.controls {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
}

.controls .button {
    min-height: 43px;
    padding: 9px 15px;
    font-size: 0.8rem;
}

.export-settings {
    display: grid;
    grid-template-columns: 0.65fr 1fr 1.15fr 1.15fr 1.2fr;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.export-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.export-field > span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.export-field select,
.export-field input[type="text"] {
    width: 100%;
    font-size: 0.76rem;
}

.quality-field > span {
    display: flex;
    justify-content: space-between;
}

.quality-field output {
    color: var(--coral-dark);
    font-weight: 800;
}

.quality-field input[type="range"],
.zoom-control input[type="range"] {
    width: 100%;
    accent-color: var(--coral);
}

.quality-field.is-disabled {
    opacity: 0.45;
}

.photo-editor {
    width: min(calc(100% - 30px), 980px);
    max-height: min(860px, calc(100vh - 30px));
    padding: 0;
    overflow: hidden auto;
    border: 0;
    border-radius: 24px;
    color: var(--ink);
    background: var(--paper);
    box-shadow: 0 30px 100px rgba(9, 15, 28, 0.4);
}

.photo-editor::backdrop {
    background: rgba(14, 20, 32, 0.72);
    backdrop-filter: blur(5px);
}

.editor-header,
.editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px;
}

.editor-header {
    border-bottom: 1px solid var(--line);
}

.editor-header .section-kicker {
    margin-bottom: 4px;
}

.editor-header h2 {
    margin-bottom: 2px;
    font-size: 1.45rem;
    line-height: 1.2;
}

.editor-header p:last-child {
    max-width: 600px;
    margin-bottom: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-button {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink-soft);
    background: var(--white);
    cursor: pointer;
}

.icon-button svg {
    width: 19px;
    height: 19px;
}

.editor-body {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.5fr);
    gap: 24px;
    padding: 26px;
}

.editor-stage {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    padding: 18px;
    border-radius: 17px;
    background: #ece8e1;
    background-image: radial-gradient(rgba(23, 32, 51, 0.08) 0.7px, transparent 0.7px);
    background-size: 7px 7px;
}

#editor-canvas {
    display: block;
    max-width: 100%;
    max-height: 520px;
    border-radius: 8px;
    box-shadow: 0 16px 35px rgba(23, 32, 51, 0.2);
    cursor: grab;
    touch-action: none;
}

#editor-canvas.is-dragging {
    cursor: grabbing;
}

.editor-stage p {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 0.72rem;
}

.editor-controls {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.editor-control-group {
    margin: 0;
    padding: 0;
    border: 0;
}

.editor-control-group legend,
.editor-control-group > strong,
.editor-control-group > span strong {
    display: block;
    margin-bottom: 8px;
    color: var(--ink-soft);
    font-size: 0.78rem;
}

.zoom-control > span {
    display: flex;
    justify-content: space-between;
}

.zoom-control > span output {
    color: var(--coral-dark);
    font-size: 0.75rem;
    font-weight: 800;
}

.segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 3px;
    border-radius: 10px;
    background: #ece8e1;
}

.segmented-control button,
.editor-button-row button,
.reset-edit-button {
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    color: var(--ink-soft);
    background: transparent;
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 700;
}

.segmented-control button.is-selected {
    color: var(--violet);
    background: var(--white);
    box-shadow: 0 3px 10px rgba(23, 32, 51, 0.08);
}

.editor-button-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.editor-button-row button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--line-strong);
    background: var(--white);
}

.reset-edit-button {
    margin-top: auto;
    border: 1px solid #f3c4bf;
    color: var(--danger);
    background: var(--danger-soft);
}

.editor-footer {
    border-top: 1px solid var(--line);
    background: #f8f6f1;
}

.editor-footer p {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
}

.privacy-section {
    display: grid;
    grid-template-columns: 0.65fr 1.35fr;
    gap: 72px;
    align-items: center;
    padding: 98px max(20px, calc((100% - var(--max-width)) / 2));
    color: var(--white);
    background: var(--ink);
}

.privacy-visual {
    display: grid;
    place-items: center;
}

.shield-ring {
    display: grid;
    place-items: center;
    width: 210px;
    height: 210px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: #6fdfbd;
    background: radial-gradient(circle, rgba(34, 168, 132, 0.16), transparent 68%);
    box-shadow: 0 0 0 38px rgba(255, 255, 255, 0.025), 0 0 0 76px rgba(255, 255, 255, 0.018);
}

.shield-ring svg {
    width: 75px;
    height: 75px;
    stroke-width: 1.25;
}

.privacy-copy {
    max-width: 670px;
}

.privacy-copy h2 {
    max-width: 620px;
}

.privacy-copy > p:not(.section-kicker) {
    color: #aeb6c5;
}

.privacy-copy ul {
    display: grid;
    gap: 9px;
    margin: 25px 0 0;
    padding: 0;
    list-style: none;
    color: #d6dbe4;
    font-size: 0.9rem;
}

.privacy-copy li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.privacy-copy li span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
}

.site-footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 25px;
    width: min(calc(100% - 40px), var(--max-width));
    margin: 0 auto;
    padding: 33px 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.site-footer p {
    margin: 0;
}

.site-footer > p:nth-child(2) {
    text-align: center;
}

.site-footer strong {
    color: var(--ink);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand strong,
.footer-brand small {
    display: block;
}

.footer-brand strong {
    color: var(--ink);
    font-family: "Segoe UI Variable Display", "Aptos Display", ui-sans-serif, sans-serif;
}

.footer-brand small {
    font-size: 0.68rem;
}

.copyright {
    text-align: right;
}

.copyright a {
    color: var(--ink-soft);
    text-underline-offset: 3px;
}

.copyright a:hover {
    color: var(--coral-dark);
}

.upload-zone:focus-visible,
.button:focus-visible,
.template-action:focus-visible,
.toolbar-button:focus-visible,
.photo-action:focus-visible,
.icon-button:focus-visible,
.segmented-control button:focus-visible,
.editor-button-row button:focus-visible,
.reset-edit-button:focus-visible,
#editor-canvas:focus-visible,
.site-header a:focus-visible,
.text-link:focus-visible {
    outline: 3px solid rgba(124, 92, 255, 0.34);
    outline-offset: 4px;
}

@media (max-width: 980px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 35px;
        padding-top: 55px;
    }

    .hero-copy {
        max-width: 720px;
    }

    .hero-showcase {
        width: min(100%, 600px);
        min-height: 480px;
        margin: 0 auto;
    }

    .template-card {
        grid-template-columns: 104px minmax(0, 1fr);
    }

    .template-preview-wrap {
        width: 104px;
        height: 84px;
    }

    .workspace-steps small {
        display: none;
    }

    .export-bar {
        align-items: stretch;
    }

    .controls {
        width: 100%;
    }

    .controls .button {
        flex: 1;
    }

    .export-settings {
        grid-template-columns: repeat(3, 1fr);
    }

    .quality-field {
        grid-column: span 2;
    }
}

@media (max-width: 760px) {
    .site-nav {
        display: none;
    }

    .hero {
        min-height: 0;
        padding: 48px 0 70px;
    }

    .hero h1 {
        font-size: clamp(3.1rem, 14vw, 5rem);
    }

    .hero-showcase {
        min-height: 420px;
    }

    .showcase-card {
        width: 225px;
    }

    .how-grid {
        grid-template-columns: 1fr;
    }

    .how-card {
        min-height: 0;
    }

    .how-card.featured {
        transform: none;
    }

    .how-icon {
        margin-bottom: 30px;
    }

    .workspace-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .workspace-steps {
        grid-template-columns: repeat(4, auto);
        justify-content: space-between;
        padding-inline: 5px;
    }

    .workspace-steps li {
        gap: 0;
    }

    .workspace-steps li div {
        display: none;
    }

    .workspace-steps li:not(:last-child)::after {
        left: 38px;
        width: calc(25vw - 48px);
    }

    .tool-section {
        padding: 32px 24px;
    }

    .panel-divider {
        margin: 0 24px;
    }

    .main-status {
        margin-inline: 24px;
    }

    progress {
        width: calc(100% - 48px);
        margin-inline: 24px;
    }

    .template-manager {
        grid-template-columns: 1fr;
    }

    .preview-container {
        padding-inline: 24px;
    }

    .export-bar {
        padding: 24px;
    }

    .gallery-toolbar {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .toolbar-spacer {
        display: none;
    }

    .compact-field {
        width: 100%;
        order: 3;
    }

    .compact-field select {
        flex: 1;
    }

    .export-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .export-settings {
        grid-template-columns: repeat(2, 1fr);
    }

    .quality-field {
        grid-column: auto;
    }

    .editor-body {
        grid-template-columns: 1fr;
    }

    .editor-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .reset-edit-button {
        margin-top: 0;
    }

    .privacy-section {
        grid-template-columns: 1fr;
        gap: 55px;
    }

    .shield-ring {
        width: 150px;
        height: 150px;
    }

    .site-footer {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        justify-content: center;
    }

    .copyright,
    .site-footer > p:nth-child(2) {
        text-align: center;
    }
}

@media (max-width: 520px) {
    .site-header,
    .hero,
    .workspace-shell,
    .site-footer {
        width: min(calc(100% - 28px), var(--max-width));
    }

    .nav-cta {
        padding: 8px 12px;
        font-size: 0.76rem;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .text-link {
        align-self: flex-start;
    }

    .hero-showcase {
        min-height: 350px;
    }

    .showcase-card {
        width: 175px;
        border-width: 5px;
    }

    .showcase-back {
        top: 42px;
        left: 20px;
    }

    .showcase-front {
        right: 15px;
        bottom: 38px;
    }

    .floating-pill {
        padding: 8px 10px;
        font-size: 0.67rem;
    }

    .pill-privacy {
        right: -3px;
    }

    .how-section,
    .privacy-section {
        padding-inline: 20px;
    }

    .workspace-shell {
        padding-block: 78px;
    }

    .tool-panel {
        border-radius: 20px;
    }

    .upload-zone {
        grid-template-columns: auto 1fr;
        padding: 18px;
    }

    .browse-label {
        grid-column: 1 / -1;
        text-align: center;
    }

    .template-card {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 13px;
    }

    .template-preview-wrap {
        width: 96px;
        height: 76px;
    }

    .template-preview-wrap.portrait-preview {
        width: 65px;
        height: 96px;
    }

    #preview-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .preview-item {
        min-width: 0;
    }

    .export-copy {
        align-items: flex-start;
    }

    .controls {
        flex-direction: column;
    }

    .export-settings,
    .editor-controls {
        grid-template-columns: 1fr;
    }

    .photo-editor {
        width: calc(100% - 16px);
        max-height: calc(100vh - 16px);
        border-radius: 18px;
    }

    .editor-header,
    .editor-footer,
    .editor-body {
        padding: 18px;
    }

    .editor-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .editor-footer .button {
        width: 100%;
    }

    .privacy-copy h2 {
        font-size: 2.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
