:root {
    --bg: #f6f2ed;
    --surface: #fffdfb;
    --surface-muted: #f2ebe5;
    --surface-strong: #e9ddd3;
    --ink: #231d19;
    --ink-muted: #71665f;
    --ink-soft: #9a8c83;
    --line: #e2d8d0;
    --accent: #9c5f3f;
    --accent-dark: #75432d;
    --accent-soft: #f3dfd2;
    --success: #36715b;
    --success-soft: #e1efe8;
    --danger: #9a433b;
    --danger-soft: #f8e5e1;
    --shadow-sm: 0 8px 24px rgba(58, 43, 34, 0.06);
    --shadow-lg: 0 24px 60px rgba(58, 43, 34, 0.11);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --compare: 55%;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(220, 186, 162, 0.2), transparent 28rem),
        radial-gradient(circle at 90% 25%, rgba(193, 158, 133, 0.12), transparent 30rem),
        var(--bg);
    color: var(--ink);
}

button,
input,
label {
    font: inherit;
}

button,
label[for] {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

button:focus-visible,
input:focus-visible,
label:focus-visible {
    outline: 3px solid rgba(156, 95, 63, 0.28);
    outline-offset: 3px;
}

svg {
    display: block;
}

.is-hidden {
    display: none !important;
}

.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;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    font-size: 17px;
    font-weight: 760;
    letter-spacing: -0.02em;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #f8f1eb;
    background: var(--ink);
    box-shadow: 0 7px 18px rgba(35, 29, 25, 0.16);
}

.brand-mark svg {
    width: 30px;
    height: 30px;
}

.mvp-badge {
    padding: 4px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-muted);
    background: rgba(255, 253, 251, 0.68);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.runtime-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid rgba(226, 216, 208, 0.9);
    border-radius: 999px;
    color: var(--ink-muted);
    background: rgba(255, 253, 251, 0.72);
    backdrop-filter: blur(14px);
    font-size: 12px;
    font-weight: 650;
    box-shadow: var(--shadow-sm);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ba8b68;
    box-shadow: 0 0 0 4px rgba(186, 139, 104, 0.13);
}

.runtime-status[data-state="loading"] .status-dot {
    animation: pulse 1.2s ease-in-out infinite;
}

.runtime-status[data-state="ready"] .status-dot {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(54, 113, 91, 0.13);
}

.runtime-status[data-state="error"] .status-dot {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(154, 67, 59, 0.13);
}

.main-content {
    width: min(1220px, calc(100% - 40px));
    margin: 0 auto;
    flex: 1;
    padding: 44px 0 54px;
}

.hero-copy {
    max-width: 760px;
    margin-bottom: 34px;
}

.eyebrow-label,
.processing-kicker,
.error-kicker,
.section-kicker {
    margin: 0 0 9px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.hero-copy h1 {
    margin: 0;
    max-width: 720px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(38px, 5vw, 64px);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.hero-description {
    max-width: 690px;
    margin: 20px 0 0;
    color: var(--ink-muted);
    font-size: 16px;
    line-height: 1.7;
}

.studio-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.78fr);
    gap: 22px;
    align-items: start;
}

.workspace-card,
.controls-card {
    border: 1px solid rgba(226, 216, 208, 0.9);
    border-radius: var(--radius-lg);
    background: rgba(255, 253, 251, 0.9);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    backdrop-filter: blur(18px);
}

.workspace-card {
    min-height: 650px;
    display: flex;
    flex-direction: column;
}

.upload-panel,
.processing-panel,
.error-panel {
    min-height: 580px;
    padding: 38px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.drop-zone {
    width: min(100%, 610px);
    min-height: 340px;
    padding: 46px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1.5px dashed #cdbeb3;
    border-radius: 24px;
    background:
        radial-gradient(circle at 50% 20%, rgba(244, 223, 210, 0.38), transparent 48%),
        #fbf8f5;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
    border-color: var(--accent);
    background:
        radial-gradient(circle at 50% 20%, rgba(244, 223, 210, 0.62), transparent 50%),
        #fffaf6;
    box-shadow: inset 0 0 0 4px rgba(156, 95, 63, 0.05);
    transform: translateY(-2px);
}

.upload-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
    border-radius: 22px;
    color: var(--accent);
    background: var(--accent-soft);
}

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

.drop-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 27px;
    line-height: 1.1;
}

.drop-subtitle {
    margin-top: 8px;
    color: var(--ink-muted);
    font-size: 14px;
}

.choose-button {
    margin-top: 24px;
    padding: 12px 19px;
    border-radius: 12px;
    color: #fff;
    background: var(--ink);
    font-size: 13px;
    font-weight: 720;
    box-shadow: 0 8px 18px rgba(35, 29, 25, 0.14);
}

.upload-help {
    margin: 17px 0 0;
    color: var(--ink-soft);
    font-size: 12px;
}

.photo-tips {
    width: min(100%, 610px);
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.photo-tip {
    min-height: 54px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink-muted);
    background: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    font-weight: 650;
    text-align: left;
}

.tip-icon {
    flex: 0 0 auto;
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-size: 11px;
    font-weight: 800;
}

.processing-panel h2,
.error-panel h2,
.controls-placeholder h2,
.section-heading h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.processing-panel h2,
.error-panel h2 {
    font-size: 30px;
}

.processing-panel > p:not(.processing-kicker),
.error-panel > p:not(.error-kicker) {
    max-width: 470px;
    margin: 12px 0 0;
    color: var(--ink-muted);
    font-size: 14px;
    line-height: 1.6;
}

.processing-visual {
    width: 154px;
    height: 154px;
    margin-bottom: 28px;
}

.scan-frame {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: radial-gradient(circle, rgba(243, 223, 210, 0.7), transparent 70%);
    overflow: hidden;
}

.scan-frame svg {
    width: 122px;
    height: 122px;
}

.scan-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: var(--accent);
    border-style: solid;
}

.scan-corner-a {
    left: 0;
    top: 0;
    border-width: 2px 0 0 2px;
    border-radius: 10px 0 0;
}

.scan-corner-b {
    right: 0;
    top: 0;
    border-width: 2px 2px 0 0;
    border-radius: 0 10px 0 0;
}

.scan-corner-c {
    right: 0;
    bottom: 0;
    border-width: 0 2px 2px 0;
    border-radius: 0 0 10px;
}

.scan-corner-d {
    left: 0;
    bottom: 0;
    border-width: 0 0 2px 2px;
    border-radius: 0 0 0 10px;
}

.scan-line {
    position: absolute;
    left: 6px;
    right: 6px;
    height: 2px;
    top: 15%;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    box-shadow: 0 0 14px rgba(156, 95, 63, 0.6);
    animation: scan 1.8s ease-in-out infinite;
}

.progress-track {
    width: min(360px, 80%);
    height: 6px;
    margin-top: 28px;
    border-radius: 999px;
    background: var(--surface-strong);
    overflow: hidden;
}

.progress-track span {
    display: block;
    width: 18%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 250ms ease;
}

.error-icon {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    margin-bottom: 25px;
    border-radius: 24px;
    color: var(--danger);
    background: var(--danger-soft);
}

.error-icon svg {
    width: 42px;
    height: 42px;
}

.error-panel ul {
    width: min(100%, 520px);
    margin: 24px 0 28px;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 9px;
    text-align: left;
}

.error-panel li {
    position: relative;
    padding: 12px 14px 12px 38px;
    border: 1px solid #efd2cd;
    border-radius: 12px;
    color: #783a34;
    background: #fff8f6;
    font-size: 13px;
    line-height: 1.45;
}

.error-panel li::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 17px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
}

.primary-button,
.secondary-button,
.download-button {
    border: 0;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, opacity 150ms ease;
}

.primary-button {
    padding: 13px 20px;
    border-radius: 13px;
    color: #fff;
    background: var(--ink);
    font-size: 13px;
    font-weight: 750;
    box-shadow: 0 10px 22px rgba(35, 29, 25, 0.15);
}

.primary-button:hover,
.download-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 13px 28px rgba(35, 29, 25, 0.19);
}

.editor-workspace {
    padding: 18px 18px 22px;
}

.image-stage {
    --compare: 55%;
    position: relative;
    width: 100%;
    min-height: 460px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background:
        linear-gradient(45deg, #e8dfd8 25%, transparent 25%),
        linear-gradient(-45deg, #e8dfd8 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e8dfd8 75%),
        linear-gradient(-45deg, transparent 75%, #e8dfd8 75%),
        #f1ebe6;
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(35, 29, 25, 0.06);
}

.image-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    touch-action: none;
    cursor: ew-resize;
}

.after-layer {
    position: absolute;
    inset: 0;
    clip-path: inset(0 calc(100% - var(--compare)) 0 0);
    touch-action: none;
    cursor: ew-resize;
}

.after-layer canvas {
    position: absolute;
    inset: 0;
}

.stage-label {
    position: absolute;
    top: 15px;
    z-index: 4;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 999px;
    color: #fff;
    background: rgba(26, 22, 19, 0.56);
    backdrop-filter: blur(10px);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
}

.before-label {
    left: 15px;
}

.after-label {
    right: 15px;
}

.compare-line {
    position: absolute;
    z-index: 3;
    top: 0;
    bottom: 0;
    left: var(--compare);
    width: 2px;
    transform: translateX(-1px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 1px rgba(35, 29, 25, 0.18), 0 0 16px rgba(35, 29, 25, 0.22);
    pointer-events: none;
}

.compare-handle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    border-radius: 50%;
    color: var(--ink);
    background: rgba(255, 253, 251, 0.94);
    box-shadow: 0 7px 22px rgba(35, 29, 25, 0.25);
    pointer-events: auto;
    cursor: ew-resize;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transition: width 160ms ease, height 160ms ease, box-shadow 160ms ease, border-width 160ms ease;
}

.compare-handle.is-pressed {
    width: 64px;
    height: 64px;
    border-width: 3px;
    box-shadow: 0 14px 32px rgba(35, 29, 25, 0.42);
}

.compare-handle svg {
    width: 26px;
    height: 26px;
}

.rendering-badge {
    position: absolute;
    right: 15px;
    bottom: 15px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border-radius: 999px;
    color: #fff;
    background: rgba(35, 29, 25, 0.76);
    backdrop-filter: blur(10px);
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
}

.mobile-style-picker-button,
.mobile-style-picker-drawer {
    display: none;
}

.mobile-style-picker-drawer[hidden],
.mobile-style-tooltip[hidden] {
    display: none !important;
}

.mini-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 650ms linear infinite;
}

.compare-control {
    margin: 17px 4px 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    color: var(--ink-muted);
    font-size: 11px;
    font-weight: 700;
}

.workspace-actions {
    margin-top: 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.secondary-button {
    min-height: 40px;
    padding: 9px 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--ink-muted);
    background: #fff;
    font-size: 12px;
    font-weight: 700;
}

.secondary-button:hover {
    border-color: #cdbeb3;
    color: var(--ink);
    background: #fcf8f5;
}

.secondary-button svg {
    width: 18px;
    height: 18px;
}

.privacy-strip {
    margin-top: auto;
    min-height: 68px;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    border-top: 1px solid var(--line);
    color: var(--ink-muted);
    background: rgba(246, 242, 237, 0.72);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.privacy-strip svg {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    color: var(--success);
}

.privacy-strip strong {
    color: var(--ink);
}

.controls-card {
    min-height: 650px;
}

.controls-placeholder {
    min-height: 300px;
}

.controls-placeholder {
    min-height: 648px;
    padding: 40px 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.placeholder-icon {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    margin-bottom: 22px;
    border-radius: 28px;
    color: var(--accent);
    background: var(--accent-soft);
}

.placeholder-icon svg {
    width: 52px;
    height: 52px;
}

.controls-placeholder h2 {
    font-size: 27px;
}

.controls-placeholder p {
    max-width: 290px;
    margin: 12px 0 0;
    color: var(--ink-muted);
    font-size: 13px;
    line-height: 1.6;
}

.controls-content {
    padding: 27px;
}

.control-section + .control-section {
    margin-top: 27px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.section-heading {
    margin-bottom: 17px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.section-heading h2 {
    font-size: 23px;
}

.compact-heading {
    margin-bottom: 14px;
}

.application-mode-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.application-mode-option {
    position: relative;
    display: block;
    cursor: pointer;
}

.application-mode-option input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.application-mode-option > span {
    min-height: 76px;
    padding: 12px;
    display: grid;
    align-content: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--ink-muted);
    background: #fff;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.application-mode-option strong {
    color: var(--ink);
    font-size: 12px;
}

.application-mode-option small {
    font-size: 10px;
    line-height: 1.4;
}

.application-mode-option input:checked + span {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: #fff8f3;
    box-shadow: inset 0 0 0 1px rgba(156, 95, 63, 0.14);
}

.application-mode-option input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.adjust-deviation-control {
    margin-top: 16px;
    padding-top: 15px;
    border-top: 1px solid var(--line);
}

.adjust-deviation-control[hidden] {
    display: none;
}

.adjust-deviation-control .custom-settings-help {
    margin-top: 8px;
}

.section-kicker {
    margin-bottom: 5px;
    font-size: 9px;
}

.instant-badge {
    margin-top: 2px;
    padding: 6px 8px;
    border-radius: 999px;
    color: var(--success);
    background: var(--success-soft);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.style-option {
    min-height: 82px;
    padding: 10px 7px 9px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--ink-muted);
    background: #fff;
    cursor: pointer;
    font-size: 10px;
    font-weight: 750;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.style-option:hover {
    transform: translateY(-1px);
    border-color: #cbb9ac;
    color: var(--ink);
}

.style-option.is-selected {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: #fff8f3;
    box-shadow: inset 0 0 0 1px rgba(156, 95, 63, 0.14);
}

.brow-sample {
    --brow-top: 8px;
    --brow-height: 8px;
    --brow-rotation: -3deg;
    --brow-bed-opacity: .2;
    --brow-strand-opacity: .95;
    --brow-blur: .2px;
    --brow-clip: polygon(0 45%, 15% 20%, 43% 5%, 72% 15%, 100% 60%, 95% 90%, 65% 65%, 30% 70%, 5% 100%);
    --brow-texture:
        repeating-linear-gradient(68deg, transparent 0 .9px, rgba(74, 52, 41, .95) 1.05px 2.1px, transparent 2.25px 3.1px),
        repeating-linear-gradient(82deg, transparent 0 2.1px, rgba(101, 73, 57, .64) 2.3px 3.15px, transparent 3.3px 4.7px);
    position: relative;
    width: 50px;
    height: 21px;
    display: block;
}

.brow-sample-canvas {
    width: 60px;
    height: 24px;
    display: block;
    border-radius: 7px;
}

.brow-sample::before,
.brow-sample::after {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    top: var(--brow-top);
    height: var(--brow-height);
    border-radius: 60% 60% 55% 45% / 75% 80% 35% 35%;
    transform: rotate(var(--brow-rotation));
    clip-path: var(--brow-clip);
}

.brow-sample::before {
    background: linear-gradient(90deg, transparent, #4a3429 18% 82%, transparent);
    filter: blur(var(--brow-blur));
    opacity: var(--brow-bed-opacity);
}

.brow-sample::after {
    background: var(--brow-texture);
    opacity: var(--brow-strand-opacity);
}

.sample-soft {
    --brow-height: 6px;
    --brow-bed-opacity: .12;
    --brow-strand-opacity: .54;
    --brow-blur: .45px;
}

.sample-straight {
    --brow-top: 10px;
    --brow-rotation: -1deg;
    --brow-clip: polygon(0 35%, 35% 15%, 70% 20%, 100% 45%, 96% 80%, 60% 65%, 25% 70%, 4% 95%);
}

.sample-arched {
    --brow-top: 7px;
    --brow-height: 9px;
    --brow-clip: polygon(0 65%, 18% 45%, 45% 5%, 67% 0, 100% 58%, 94% 88%, 67% 45%, 47% 40%, 20% 80%, 5% 100%);
}

.sample-feathered {
    --brow-top: 7px;
    --brow-height: 10px;
    --brow-bed-opacity: .1;
    --brow-strand-opacity: .82;
    --brow-texture:
        repeating-linear-gradient(78deg, transparent 0 1px, rgba(74, 52, 41, .92) 1.15px 2.2px, transparent 2.35px 3.3px),
        repeating-linear-gradient(87deg, transparent 0 2.4px, rgba(101, 73, 57, .54) 2.55px 3.45px, transparent 3.6px 5px);
}

.sample-custom {
    --brow-top: 7px;
    --brow-height: 9px;
    --brow-bed-opacity: .15;
    --brow-strand-opacity: .9;
    --brow-clip: polygon(0 54%, 15% 28%, 48% 4%, 72% 12%, 100% 58%, 94% 92%, 66% 61%, 31% 72%, 4% 100%);
}

.style-option[data-style="custom"] {
    border-style: dashed;
}

.custom-settings-panel {
    padding: 20px;
    border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
    border-radius: 15px;
    background: color-mix(in srgb, var(--accent-soft) 48%, #fff);
}

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

.custom-settings-heading {
    align-items: center;
    margin-bottom: 8px;
}

.custom-settings-help {
    margin: 0 0 20px;
    color: var(--ink-muted);
    font-size: 11px;
    line-height: 1.55;
}

.custom-reset-button {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--accent-dark);
    background: #fff;
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.custom-slider-group {
    display: grid;
    gap: 12px;
}

.custom-slider-group + .custom-slider-group {
    margin-top: 22px;
    padding-top: 19px;
    border-top: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
}

.custom-slider-group h3 {
    color: var(--ink);
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sample-browless {
    --brow-top: 10px;
    --brow-height: 1px;
    --brow-rotation: 0deg;
    --brow-clip: inset(0);
    --brow-bed-opacity: 1;
    --brow-blur: 0;
}

.sample-browless::before {
    background: #cdbfb6;
}

.sample-browless::after {
    display: none;
}

.color-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.matched-color-option {
    width: 100%;
    min-height: 52px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: #fff;
    cursor: pointer;
    text-align: start;
}

.matched-color-option.is-selected {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(156, 95, 63, 0.14);
}

.matched-color-swatch {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: block;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #4a3429;
    box-shadow: 0 0 0 1px rgba(35, 29, 25, 0.16);
}

.matched-color-copy {
    display: grid;
    gap: 2px;
}

.matched-color-copy strong {
    font-size: 11px;
}

.matched-color-copy small {
    color: var(--ink-muted);
    font-size: 9px;
}

.color-swatch {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: transform 150ms ease, border-color 150ms ease;
}

.color-swatch:hover {
    transform: scale(1.06);
}

.color-swatch.is-selected {
    border-color: var(--ink);
}

.color-swatch span {
    width: 27px;
    height: 27px;
    display: block;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(35, 29, 25, 0.12);
}

.swatch-black { background: #171412; }
.swatch-espresso { background: #30241f; }
.swatch-dark-brown { background: #4a3429; }
.swatch-warm-brown { background: #76513c; }
.swatch-taupe { background: #9a7658; }
.swatch-auburn { background: #b4865f; }

.advanced-settings-button {
    width: 100%;
    margin-top: 24px;
    padding: 13px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(35, 29, 25, 0.14);
    border-radius: 12px;
    color: var(--ink);
    background: var(--surface);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.advanced-settings-button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
    outline-offset: 2px;
}

.advanced-settings-icon {
    display: inline-block;
    font-size: 18px;
    line-height: 1;
    transition: transform 160ms ease;
}

.advanced-settings-button[aria-expanded="true"] .advanced-settings-icon {
    transform: rotate(180deg);
}

.slider-section {
    display: grid;
    gap: 19px;
}

.slider-section[hidden] {
    display: none !important;
}

.overlap-hair-opacity-control {
    display: grid;
    gap: 8px;
}

.overlap-hair-opacity-control[hidden] {
    display: none !important;
}

.overlap-hair-opacity-control .custom-settings-help {
    margin: 0;
}

.slider-control {
    display: grid;
    gap: 9px;
}

.slider-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink-muted);
    font-size: 11px;
    font-weight: 700;
}

.slider-label output {
    min-width: 38px;
    color: var(--ink);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.synthetic-hair-toggle {
    margin-top: 16px;
    padding-top: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid rgba(35, 29, 25, 0.1);
    cursor: pointer;
}

.synthetic-hair-toggle-copy {
    display: grid;
    gap: 3px;
}

.synthetic-hair-toggle-copy strong {
    color: var(--ink);
    font-size: 12px;
}

.synthetic-hair-toggle-copy small {
    max-width: 260px;
    color: var(--ink-muted);
    font-size: 10px;
    line-height: 1.45;
}

.synthetic-hair-switch {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
}

.synthetic-hair-switch input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.synthetic-hair-switch-track {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(35, 29, 25, 0.18);
    border-radius: 999px;
    background: rgba(35, 29, 25, 0.12);
    transition: background 150ms ease, border-color 150ms ease;
}

.synthetic-hair-switch-track::after {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(35, 29, 25, 0.22);
    content: '';
    transition: transform 150ms ease;
}

.synthetic-hair-switch input:checked + .synthetic-hair-switch-track {
    border-color: var(--accent);
    background: var(--accent);
}

.synthetic-hair-switch input:checked + .synthetic-hair-switch-track::after {
    transform: translateX(18px);
}

[dir="rtl"] .synthetic-hair-switch-track::after {
    right: 2px;
    left: auto;
}

[dir="rtl"] .synthetic-hair-switch input:checked + .synthetic-hair-switch-track::after {
    transform: translateX(-18px);
}

.synthetic-hair-switch input:focus-visible + .synthetic-hair-switch-track {
    outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
    outline-offset: 2px;
}

input[type="range"] {
    --range-progress: 50%;
    width: 100%;
    height: 20px;
    margin: 0;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--accent) 0 var(--range-progress), var(--surface-strong) var(--range-progress) 100%);
}

input[type="range"]::-moz-range-track {
    height: 5px;
    border-radius: 999px;
    background: var(--surface-strong);
}

input[type="range"]::-moz-range-progress {
    height: 5px;
    border-radius: 999px;
    background: var(--accent);
}

input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -6.5px;
    appearance: none;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 2px 7px rgba(35, 29, 25, 0.22);
}

input[type="range"]::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 2px 7px rgba(35, 29, 25, 0.22);
}

.quality-card {
    margin-top: 27px;
    padding: 15px;
    border: 1px solid #cfe1d8;
    border-radius: 15px;
    background: #f6fbf8;
}

.quality-heading {
    display: flex;
    align-items: center;
    gap: 11px;
}

.quality-check {
    flex: 0 0 auto;
    width: 33px;
    height: 33px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--success);
    background: var(--success-soft);
}

.quality-check svg {
    width: 20px;
    height: 20px;
}

.quality-heading > div {
    display: grid;
    gap: 2px;
}

.quality-heading strong {
    font-size: 12px;
}

.quality-heading span:not(.quality-check) {
    color: var(--ink-muted);
    font-size: 10px;
}

.removal-confidence {
    --confidence-color: var(--warning, #a86f19);
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid color-mix(in srgb, var(--success) 20%, var(--line));
}

.removal-confidence[hidden] {
    display: none !important;
}

.removal-confidence[data-level="high"] {
    --confidence-color: var(--success);
}

.removal-confidence[data-level="low"] {
    --confidence-color: var(--danger);
}

.removal-confidence-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink-muted);
    font-size: 10px;
    font-weight: 750;
}

.removal-confidence-heading strong {
    color: var(--confidence-color);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.removal-confidence-meter {
    --removal-confidence: 0%;
    height: 7px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--line) 72%, transparent);
}

.removal-confidence-meter span {
    width: var(--removal-confidence);
    height: 100%;
    display: block;
    border-radius: inherit;
    background: var(--confidence-color);
    transition: width 220ms ease, background-color 160ms ease;
}

.removal-confidence-copy {
    margin-top: 8px;
    display: grid;
    gap: 3px;
}

.removal-confidence-copy strong {
    color: var(--confidence-color);
    font-size: 10px;
}

.removal-confidence-copy p {
    margin: 0;
    color: var(--ink-muted);
    font-size: 9px;
    line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
    .removal-confidence-meter span {
        transition: none;
    }
}

.metric-grid {
    margin-top: 13px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
}

.metric-pill {
    padding: 7px 9px;
    border: 1px solid rgba(207, 225, 216, 0.8);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    color: var(--ink-muted);
    background: rgba(255, 255, 255, 0.7);
    font-size: 9px;
}

.metric-pill strong {
    color: var(--success);
    font-size: 9px;
}

.warning-list {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
}

.warning-list li {
    padding: 7px 9px;
    border-radius: 8px;
    color: #795c2c;
    background: #fff5df;
    font-size: 9px;
    line-height: 1.35;
}

.download-button {
    width: 100%;
    min-height: 50px;
    margin-top: 20px;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 14px;
    color: #fff;
    background: var(--ink);
    font-size: 13px;
    font-weight: 760;
    box-shadow: 0 10px 22px rgba(35, 29, 25, 0.15);
}

.download-button:disabled {
    cursor: wait;
    opacity: .62;
    transform: none;
}

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

.export-note {
    margin: 9px 0 0;
    color: var(--ink-soft);
    font-size: 9px;
    line-height: 1.45;
    text-align: center;
}

.site-footer {
    width: min(1220px, calc(100% - 40px));
    min-height: 70px;
    margin: 0 auto;
    padding: 20px 0 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 10px;
    text-align: center;
}

.toast {
    position: fixed;
    z-index: 30;
    left: 50%;
    bottom: 26px;
    max-width: min(440px, calc(100% - 32px));
    padding: 12px 16px;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 13px;
    color: #fff;
    background: rgba(35, 29, 25, 0.94);
    box-shadow: 0 14px 35px rgba(35, 29, 25, 0.25);
    font-size: 12px;
    font-weight: 650;
    text-align: center;
    animation: toast-in 180ms ease-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(.88); opacity: .65; }
    50% { transform: scale(1.12); opacity: 1; }
}

@keyframes scan {
    0%, 100% { top: 12%; opacity: .45; }
    50% { top: 85%; opacity: 1; }
}

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

@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 980px) {
    .main-content {
        padding-top: 28px;
    }

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

    .controls-card,
    .controls-placeholder {
        min-height: auto;
    }

    .controls-placeholder {
        padding: 34px;
    }

    .controls-content {
        padding: 28px;
    }

    .style-grid {
        grid-template-columns: repeat(6, minmax(92px, 1fr));
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }
}

@media (max-width: 680px) {
    .site-header,
    .main-content,
    .site-footer {
        width: min(100% - 24px, 1220px);
    }

    .site-header {
        min-height: 72px;
    }

    .runtime-status {
        max-width: 160px;
        padding: 8px 10px;
    }

    #runtimeStatusText {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mvp-badge {
        display: none;
    }

    .main-content {
        padding: 25px 0 36px;
    }

    .hero-copy {
        margin-bottom: 25px;
    }

    .hero-copy h1 {
        font-size: clamp(38px, 12vw, 52px);
    }

    .hero-description {
        font-size: 14px;
    }

    .workspace-card,
    .controls-card {
        border-radius: 22px;
    }

    .workspace-card {
        min-height: 560px;
    }

    .upload-panel,
    .processing-panel,
    .error-panel {
        min-height: 500px;
        padding: 22px;
    }

    .drop-zone {
        min-height: 310px;
        padding: 36px 18px;
        border-radius: 19px;
    }

    .photo-tips {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .photo-tip {
        min-height: 44px;
    }

    .editor-workspace {
        padding: 10px 10px 18px;
    }

    .image-stage {
        min-height: 390px;
        border-radius: 16px;
    }

    .compare-handle.is-pressed {
        width: 72px;
        height: 72px;
    }

    .mobile-style-picker-button {
        position: absolute;
        z-index: 10;
        top: 50%;
        right: 0;
        min-width: 48px;
        min-height: 58px;
        padding: 8px 6px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        transform: translateY(-50%);
        border: 1px solid rgba(255, 255, 255, 0.56);
        border-right: 0;
        border-radius: 13px 0 0 13px;
        color: #fff;
        background: rgba(35, 29, 25, 0.78);
        box-shadow: 0 8px 24px rgba(35, 29, 25, 0.24);
        backdrop-filter: blur(12px);
        font-size: 9px;
        font-weight: 800;
        cursor: pointer;
        transition: top 160ms ease, transform 160ms ease, background 160ms ease;
    }

    .mobile-style-picker-button[aria-expanded="true"] {
        top: 20px;
        transform: none;
        background: rgba(117, 67, 45, 0.94);
    }

    .mobile-style-picker-button-icon {
        font-size: 20px;
        line-height: 1;
    }

    .mobile-style-picker-drawer {
        position: absolute;
        z-index: 9;
        top: max(12px, env(safe-area-inset-top));
        right: max(0px, env(safe-area-inset-right));
        bottom: 12px;
        width: 112px;
        max-height: calc(100% - 24px);
        padding: 58px 8px 9px;
        display: flex;
        flex-direction: column;
        gap: 7px;
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.5);
        border-right: 0;
        border-radius: 17px 0 0 17px;
        background: rgba(255, 253, 251, 0.93);
        box-shadow: -10px 0 30px rgba(35, 29, 25, 0.22);
        backdrop-filter: blur(16px);
        animation: mobile-picker-in 160ms ease-out;
    }

    .mobile-style-picker-heading {
        color: var(--ink-muted);
        font-size: 9px;
        font-weight: 800;
        line-height: 1.25;
        text-align: center;
    }

    .mobile-style-grid {
        min-height: 0;
        display: flex;
        flex: 1;
        flex-direction: column;
        gap: 7px;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 2px 2px 5px;
        scrollbar-color: rgba(156, 95, 63, 0.5) transparent;
        scrollbar-width: thin;
        touch-action: pan-y;
    }

    .mobile-style-option {
        flex: 0 0 auto;
        width: 100%;
        min-height: 62px;
        padding: 8px 5px;
        display: grid;
        place-items: center;
        border: 1px solid rgba(35, 29, 25, 0.13);
        border-radius: 12px;
        color: var(--ink);
        background: rgba(255, 255, 255, 0.88);
        cursor: pointer;
        touch-action: pan-y;
        user-select: none;
        -webkit-touch-callout: none;
    }

    .mobile-style-option.is-selected {
        border-color: var(--accent);
        color: var(--accent-dark);
        background: #fff4ed;
        box-shadow: inset 0 0 0 1px rgba(156, 95, 63, 0.18);
    }

    .mobile-style-option .brow-sample {
        transform: scale(.92);
    }

    .mobile-style-option .brow-sample-canvas {
        width: 78px;
        height: 31px;
    }

    .mobile-style-tooltip {
        position: absolute;
        z-index: 2;
        right: 8px;
        bottom: 9px;
        left: 8px;
        padding: 7px 5px;
        border-radius: 8px;
        color: #fff;
        background: rgba(35, 29, 25, 0.9);
        box-shadow: 0 6px 18px rgba(35, 29, 25, 0.2);
        font-size: 10px;
        font-weight: 750;
        line-height: 1.3;
        text-align: center;
        pointer-events: none;
    }

    .workspace-actions {
        align-items: stretch;
    }

    .secondary-button {
        flex: 1;
    }

    .privacy-strip {
        padding: 14px 16px;
        align-items: flex-start;
        text-align: left;
    }

    .controls-content {
        padding: 22px 18px;
    }

    .style-grid {
        grid-template-columns: repeat(3, 1fr);
        overflow: visible;
    }

    .instant-badge {
        display: none;
    }

    .site-footer {
        flex-wrap: wrap;
    }
}

@keyframes mobile-picker-in {
    from { opacity: 0; transform: translateX(14px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 390px) {
    .brand > span:nth-child(2) {
        display: none;
    }

    .runtime-status {
        max-width: 190px;
    }

    .workspace-actions {
        flex-direction: column;
    }

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

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