:root {
    --photo-ink: #132235;
    --photo-ink-soft: #526171;
    --photo-line: #d6e0ea;
    --photo-surface: #ffffff;
    --photo-surface-soft: #f4f8fd;
    --photo-surface-tint: #eef4ff;
    --photo-brand: #2d6df6;
    --photo-brand-soft: rgba(45, 109, 246, 0.09);
    --photo-accent: #14906c;
    --photo-danger: #c64f4a;
    --photo-warning: #c57d17;
    --photo-shadow: 0 20px 44px rgba(17, 36, 56, 0.08);
}

.photo-home {
    color: var(--photo-ink);
    background: linear-gradient(180deg, #f7faff 0%, #ffffff 30%, #f7fbff 100%);
}

.photo-home__container {
    width: min(var(--layout-container-max), calc(100% - 32px));
    max-width: var(--layout-container-max);
    margin-inline: auto;
}

.photo-home__tool-container {
    width: min(var(--layout-container-max), calc(100% - 32px));
    max-width: var(--layout-container-max);
    margin-inline: auto;
}

.photo-home__hero {
    padding: clamp(20px, 3vw, 30px) 0 12px;
}

.photo-home__hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
    gap: 24px;
    align-items: start;
}

.photo-home__eyebrow {
    margin: 0 0 10px;
    color: var(--photo-brand);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.photo-home__hero-copy h1,
.photo-home__hero-copy h2,
.photo-home__section-heading h2 {
    margin: 0;
    line-height: 1.14;
}

.photo-home__hero-copy h1 {
    max-width: 24ch;
    font-size: clamp(2.15rem, 4.5vw, 3.4rem);
    overflow-wrap: anywhere;
}

.photo-home__hero-copy h2 {
    font-size: clamp(1.9rem, 4vw, 3rem);
}

.photo-home__lead {
    margin: 10px 0 0;
    max-width: 58rem;
    color: var(--photo-ink-soft);
    font-size: 1.08rem;
    line-height: 1.7;
}

.photo-home__value-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.photo-home__value-list > div,
.photo-home__hero-card,
.photo-panel,
.photo-side-card,
.photo-result-card,
.photo-adjust-card {
    background: var(--photo-surface);
    border: 1px solid var(--photo-line);
    border-radius: 22px;
    box-shadow: var(--photo-shadow);
}

.photo-home__value-list > div {
    padding: 16px 18px;
}

.photo-home__value-list strong,
.photo-home__hero-card-label,
.photo-panel__step,
.photo-side-card h3,
.photo-adjust-card h4,
.photo-result-card__head h4,
.photo-analysis-panel__head h4,
.photo-size-fields__heading strong,
.photo-background-picker__head strong {
    display: block;
    font-weight: 700;
}

.photo-home__value-list span,
.photo-home__hero-card p,
.photo-home__hero-card li,
.photo-panel__heading p,
.photo-preset-card span,
.photo-upload-card span,
.photo-upload-status,
.photo-result-card p,
.photo-side-card p,
.photo-side-card li,
.photo-side-card dd,
.photo-side-card dt,
.photo-analysis-results__note,
.photo-home__section-heading p,
.photo-home__flow-grid li span,
.photo-home__pillars p,
.photo-home__faq p,
.photo-editor-stage__meta,
.photo-size-fields__note,
.photo-camera-panel__actions,
.photo-analysis-panel__stats span,
.photo-camera-panel__stage strong,
.photo-camera-panel__stage span,
.photo-editor-stage__placeholder span {
    color: var(--photo-ink-soft);
}

.photo-home__cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.photo-home__cta,
.photo-core__button,
.photo-core__change-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--photo-line);
    background: var(--photo-surface);
    color: var(--photo-ink);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.photo-home__cta:hover,
.photo-core__button:hover,
.photo-core__change-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(17, 36, 56, 0.08);
}

.photo-home__cta--primary,
.photo-core__button--primary {
    background: var(--photo-brand);
    border-color: var(--photo-brand);
    color: #ffffff;
}

.photo-home__hero-aside {
    display: grid;
    gap: 16px;
}

.photo-home__hero-card {
    padding: 20px;
}

.photo-home__hero-card ul {
    margin: 12px 0 0;
    padding-left: 18px;
}

.photo-home__hero-card--muted {
    background: var(--photo-brand-soft);
}

.photo-home__section {
    padding: 28px 0 42px;
}

.photo-home__section--compact {
    padding-top: 10px;
}

.photo-home__section--muted {
    background: rgba(45, 109, 246, 0.04);
}

.photo-home__section-heading {
    margin-bottom: 20px;
}

.photo-home__flow-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.photo-home__flow-grid li,
.photo-home__pillars article {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--photo-line);
    background: var(--photo-surface);
}

.photo-home__flow-grid strong,
.photo-home__pillars h3 {
    display: block;
    margin-bottom: 8px;
}

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

.photo-home__faq details {
    padding: 16px 0;
    border-bottom: 1px solid var(--photo-line);
}

.photo-home__faq summary {
    cursor: pointer;
    font-weight: 700;
}

.photo-home__faq summary + p {
    margin-top: 12px;
    line-height: 1.75;
}


.photo-core {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: clamp(640px, calc(100dvh - 106px), 760px);
    display: flex;
    flex-direction: column;
    padding: clamp(16px, 2.2cqi, 24px);
    border: 1px solid var(--photo-line);
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: var(--photo-shadow);
    container-type: inline-size;
    container-name: photo-core;
}

.photo-core,
.photo-core * {
    box-sizing: border-box;
}

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

.photo-core button,
.photo-core input,
.photo-core select,
.photo-core canvas,
.photo-core img,
.photo-core video {
    max-width: 100%;
}

.photo-core button:focus-visible,
.photo-core input:focus-visible,
.photo-core select:focus-visible,
.photo-core summary:focus-visible {
    outline: 3px solid rgba(45, 109, 246, 0.35);
    outline-offset: 2px;
}

.photo-core p {
    margin-top: 0;
}

.photo-core__purpose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1.2fr);
    gap: 16px 22px;
    align-items: center;
    min-width: 0;
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(45, 109, 246, 0.26);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(45, 109, 246, 0.08), #ffffff 64%);
}

.photo-core__purpose-copy {
    min-width: 0;
}

.photo-core__purpose-step {
    display: block;
    color: var(--photo-brand);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.photo-core__purpose-title {
    margin: 3px 0 0;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.25;
}

.photo-core__purpose-description {
    margin: 6px 0 0;
    color: var(--photo-ink-soft);
    font-size: 0.8rem;
    line-height: 1.5;
}

.photo-core__purpose-controls {
    display: grid;
    grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
    gap: 7px 10px;
    min-width: 0;
}

.photo-core__purpose-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.photo-core__purpose-field > span {
    color: var(--photo-ink-soft);
    font-size: 0.76rem;
    font-weight: 800;
}

.photo-core__purpose-field input,
.photo-core__purpose-field select {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 0 12px;
    border: 1px solid var(--photo-line);
    border-radius: 11px;
    background: #ffffff;
    color: var(--photo-ink);
    font: inherit;
    font-weight: 700;
}

.photo-core__purpose-field select {
    border-color: var(--photo-brand);
}

.photo-core__purpose-search-status {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--photo-ink-soft);
    font-size: 0.76rem;
    line-height: 1.4;
}

.photo-core__message {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 14px;
    padding: 11px 14px;
    border: 1px solid rgba(20, 144, 108, 0.25);
    border-radius: 12px;
    background: rgba(20, 144, 108, 0.08);
    color: var(--photo-accent);
    font-weight: 700;
    line-height: 1.5;
}

.photo-core__message::before {
    content: "";
    flex: 0 0 0.72rem;
    width: 0.72rem;
    height: 0.72rem;
    border: 2px solid rgba(20, 144, 108, 0.22);
    border-top-color: var(--photo-accent);
    border-radius: 50%;
    opacity: 0;
}

.photo-core__message.is-loading {
    border-color: rgba(20, 144, 108, 0.42);
    background: rgba(20, 144, 108, 0.08);
}

.photo-core__message.is-loading::before {
    opacity: 1;
    animation: photo-core-message-spin 0.85s linear infinite;
}

.photo-core__message.is-error,
.photo-field-error {
    border-color: rgba(198, 79, 74, 0.3);
    background: rgba(198, 79, 74, 0.08);
    color: var(--photo-danger);
}

.photo-core__summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
    padding: 12px 0 0;
    border-top: 1px solid var(--photo-line);
}

.photo-core__summary > div {
    min-width: 0;
    padding: 4px 10px;
    border-left: 2px solid var(--photo-line);
}

.photo-core__summary > div:first-child {
    border-left-color: var(--photo-brand);
}

.photo-core__summary span {
    display: block;
    margin-bottom: 3px;
    color: var(--photo-ink-soft);
    font-size: 0.76rem;
}

.photo-core__summary strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 0.92rem;
}

.photo-core__privacy {
    border-left-color: rgba(20, 144, 108, 0.45) !important;
}

.photo-core__privacy strong {
    color: var(--photo-accent);
}

.photo-core__traceability {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 14px;
    align-items: center;
    min-width: 0;
    margin-top: 10px;
    padding: 9px 12px;
    border: 1px solid rgba(45, 109, 246, 0.16);
    border-radius: 11px;
    background: rgba(45, 109, 246, 0.045);
}

.photo-core__traceability-heading {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.photo-core__traceability-heading > span {
    color: var(--photo-ink-soft);
    font-size: 0.7rem;
    font-weight: 800;
}

.photo-core__traceability-heading strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--photo-ink);
    font-size: 0.78rem;
}

.photo-core__traceability-meta {
    display: grid;
    grid-template-columns: minmax(0, auto);
    gap: 8px;
    min-width: 0;
    margin: 0;
}

.photo-core__traceability-meta div {
    min-width: 0;
}

.photo-core__traceability-meta dt {
    color: var(--photo-ink-soft);
    font-size: 0.66rem;
}

.photo-core__traceability-meta dd {
    margin: 2px 0 0;
    overflow: hidden;
    color: var(--photo-ink);
    font-size: 0.72rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-core__traceability-note {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--photo-ink-soft);
    font-size: 0.7rem;
    line-height: 1.45;
}

.photo-core__stages {
    margin-top: 16px;
}

.photo-stage-nav {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.photo-stage-nav legend {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.photo-stage-nav__options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.photo-stage-nav__option {
    position: relative;
    display: block;
    min-width: 0;
    cursor: pointer;
}

.photo-stage-nav__option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.photo-stage-nav__option > span {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "number title" "number hint";
    column-gap: 9px;
    min-height: 54px;
    padding: 9px 12px;
    border: 1px solid var(--photo-line);
    border-radius: 12px;
    background: var(--photo-surface-soft);
    transition: border-color 160ms ease, background-color 160ms ease;
}

.photo-stage-nav__option input:checked + span {
    border-color: var(--photo-brand);
    background: var(--photo-brand-soft);
    box-shadow: inset 3px 0 0 var(--photo-brand);
}

.photo-stage-nav__option input:focus-visible + span {
    outline: 3px solid rgba(45, 109, 246, 0.35);
    outline-offset: 2px;
}

.photo-stage-nav__option small {
    grid-area: number;
    align-self: center;
    color: var(--photo-brand);
    font-size: 0.76rem;
    font-weight: 800;
}

.photo-stage-nav__option strong {
    grid-area: title;
    min-width: 0;
    align-self: end;
    font-size: 0.92rem;
}

.photo-stage-nav__option em {
    grid-area: hint;
    min-width: 0;
    overflow: hidden;
    color: var(--photo-ink-soft);
    font-size: 0.74rem;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-core__workbench {
    display: grid;
    grid-template-columns: minmax(0, 1.48fr) minmax(315px, 1fr);
    gap: 16px;
    flex: none;
    min-height: 0;
    margin-top: 16px;
    overflow: visible;
    align-items: stretch;
}

.photo-core__preview-area,
.photo-work-panel {
    min-width: 0;
    border: 1px solid var(--photo-line);
    border-radius: 18px;
    background: #ffffff;
}

.photo-core__preview-area {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 16px;
}

.photo-core__preview-header,
.photo-core__preview-meta,
.photo-work-panel__heading,
.photo-check-summary__heading,
.photo-adjust-controls__heading,
.photo-selected-file__heading,
.photo-asset-strip__header,
.photo-camera-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.photo-work-panel__heading {
    display: grid;
    gap: 7px;
}

.photo-core__section-kicker,
.photo-panel__step {
    display: block;
    color: var(--photo-brand);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.photo-core__preview-title,
.photo-work-panel__stage-title {
    margin: 2px 0 0;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.25;
}

.photo-core__preview-title strong,
.photo-work-panel__stage-title strong,
.photo-core__purpose-title strong {
    font: inherit;
}

.photo-core__preview-badge,
.photo-analysis-results__badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--photo-brand-soft);
    color: var(--photo-brand);
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
}

.photo-core__preview-badge.is-ready {
    color: var(--photo-accent);
    background: rgba(20, 144, 108, 0.1);
}

.photo-preview-stage {
    position: relative;
    display: grid;
    flex: 1 1 auto;
    place-items: center;
    min-height: 0;
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid var(--photo-line);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.5) 25%, transparent 25%) 0 0 / 16px 16px,
        linear-gradient(315deg, rgba(255, 255, 255, 0.5) 25%, transparent 25%) 0 0 / 16px 16px,
        #edf3fb;
}

.photo-preview-view {
    position: relative;
    display: none;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.photo-preview-view:not([hidden]) {
    display: grid;
}

.photo-preview-view canvas {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
}

.photo-preview-view--stage canvas {
    cursor: grab;
    touch-action: none;
}

.photo-preview-view--stage canvas[aria-disabled="true"] {
    cursor: not-allowed;
}

.photo-preview-view--stage canvas:active {
    cursor: grabbing;
}

.photo-preview-view--single {
    padding: 16px;
}

.photo-preview-view--single canvas {
    width: min(300px, 100%);
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(19, 34, 53, 0.14);
}

.photo-preview-view--print {
    padding: 12px;
}

.photo-preview-view--print canvas {
    width: min(360px, 100%);
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(19, 34, 53, 0.12);
}

.photo-editor-stage__placeholder,
.photo-output-empty {
    position: absolute;
    inset: 16px;
    display: grid;
    place-content: center;
    gap: 7px;
    padding: 22px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--photo-ink-soft);
    text-align: center;
}

.photo-editor-stage__placeholder strong,
.photo-output-empty {
    color: var(--photo-ink);
    font-weight: 700;
}

.photo-core__preview-meta {
    flex-wrap: wrap;
    margin-top: 9px;
    color: var(--photo-ink-soft);
    font-size: 0.78rem;
    line-height: 1.45;
}

.photo-core__preview-meta span:first-child {
    color: var(--photo-ink);
    font-weight: 700;
}

.photo-asset-strip {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--photo-line);
}

.photo-asset-strip__header {
    align-items: center;
    color: var(--photo-ink-soft);
    font-size: 0.78rem;
}

.photo-asset-strip__header strong {
    color: var(--photo-ink);
}

.photo-asset-list {
    display: flex;
    gap: 8px;
    min-height: 62px;
    margin: 8px 0 0;
    padding: 0 2px 3px;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: thin;
}

.photo-asset-item {
    position: relative;
    flex: 0 0 70px;
    min-height: 58px;
}

.photo-asset-item__select {
    position: relative;
    display: block;
    width: 70px;
    height: 58px;
    padding: 2px;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 9px;
    background: var(--photo-surface-soft);
    cursor: pointer;
}

.photo-asset-item.is-active .photo-asset-item__select {
    border-color: var(--photo-brand);
    box-shadow: 0 0 0 2px rgba(45, 109, 246, 0.12);
}

.photo-asset-item__select img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 5px;
    object-fit: cover;
}

.photo-asset-item__select span {
    position: absolute;
    right: 3px;
    bottom: 3px;
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(19, 34, 53, 0.78);
    color: #ffffff;
    font-size: 0.65rem;
    line-height: 1.25;
}

.photo-asset-item__remove {
    position: absolute;
    top: -7px;
    right: -7px;
    display: grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: transparent;
    font-size: 0;
    font-weight: 800;
    cursor: pointer;
    z-index: 2;
}

.photo-asset-item__remove::before {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid #ffffff;
    border-radius: 999px;
    background: var(--photo-danger);
    color: #ffffff;
    content: "×";
    font-size: 0.78rem;
    font-weight: 800;
}

.photo-core__controls {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    overflow: visible;
}

.photo-work-panel {
    display: flex;
    min-height: 0;
    max-height: none;
    flex-direction: column;
    gap: 14px;
    overflow: visible;
    padding: 18px;
}

.photo-work-panel__heading > div,
.photo-check-summary__heading > div,
.photo-adjust-controls__heading > div,
.photo-selected-file__heading > strong {
    min-width: 0;
}

.photo-work-panel__heading > p {
    max-width: none;
    margin: 0;
    color: var(--photo-ink-soft);
    font-size: 0.78rem;
    line-height: 1.5;
    text-align: left;
}

.photo-work-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff 26%);
}

.photo-work-panel__actions .photo-core__button {
    width: 100%;
}

.photo-work-panel__actions--result {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.photo-work-panel__actions--top {
    top: 8px;
    bottom: auto;
    z-index: 3;
    margin-top: 0;
    padding: 4px 0 8px;
    background: #ffffff;
}

.photo-core__result-link {
    text-decoration: none;
}

.photo-core__button {
    min-height: 44px;
    padding: 0 15px;
    border-radius: 10px;
    border: 1px solid var(--photo-line);
    background: #ffffff;
    color: var(--photo-ink);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.photo-core__button:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(45, 109, 246, 0.48);
    box-shadow: 0 8px 18px rgba(17, 36, 56, 0.08);
}

.photo-core__button--primary {
    border-color: var(--photo-brand);
    background: var(--photo-brand);
    color: #ffffff;
}

.photo-core__button--small {
    min-height: 44px;
    padding-inline: 12px;
    font-size: 0.82rem;
}

.photo-core__button--text {
    align-self: flex-start;
    min-height: 44px;
    padding-inline: 4px;
    border: 0;
    background: transparent;
    color: var(--photo-brand);
}

.photo-core__button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
    box-shadow: none;
}

.photo-upload-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.photo-upload-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "icon title" "icon detail";
    column-gap: 12px;
    align-content: center;
    min-width: 0;
    min-height: 104px;
    padding: 14px 16px;
    border: 2px solid #b8c8d8;
    border-radius: 14px;
    background: var(--photo-surface-soft);
    color: var(--photo-ink);
    text-align: left;
    cursor: pointer;
    font: inherit;
    box-shadow: 0 8px 18px rgba(19, 34, 53, 0.08);
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.photo-upload-card--primary {
    border-color: rgba(45, 109, 246, 0.68);
    background: rgba(45, 109, 246, 0.12);
    box-shadow: 0 10px 24px rgba(45, 109, 246, 0.14);
}

.photo-upload-card--primary:has(input:not(:disabled)):hover,
button.photo-upload-card:hover:not(:disabled) {
    border-color: var(--photo-brand);
    background: var(--photo-surface-tint);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(45, 109, 246, 0.18);
}

.photo-upload-card:focus-visible,
.photo-upload-card:focus-within {
    outline: 3px solid rgba(45, 109, 246, 0.35);
    outline-offset: 3px;
}

.photo-upload-card:disabled,
.photo-upload-card:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
    box-shadow: none;
}

.photo-upload-card__icon {
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    align-self: center;
    border: 1px solid rgba(45, 109, 246, 0.18);
    border-radius: 12px;
    background: #ffffff;
    color: var(--photo-brand);
    font-size: 1.6rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(19, 34, 53, 0.08);
}

.photo-upload-card strong {
    grid-area: title;
    align-self: end;
    font-size: 1rem;
    font-weight: 800;
}

.photo-upload-card > span:last-child {
    grid-area: detail;
    margin-top: 3px;
    color: var(--photo-ink-soft);
    font-size: 0.78rem;
    line-height: 1.35;
}

.photo-upload-status {
    min-height: 24px;
    color: var(--photo-ink-soft);
    font-size: 0.8rem;
    line-height: 1.45;
}

.photo-upload-status p {
    margin: 0;
}

.photo-details {
    border-top: 1px solid var(--photo-line);
    border-bottom: 1px solid var(--photo-line);
}

.photo-details summary {
    min-height: 44px;
    padding: 12px 22px 12px 0;
    color: var(--photo-ink);
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 800;
    list-style-position: outside;
}

.photo-details summary::marker {
    color: var(--photo-brand);
}

.photo-size-fields {
    display: grid;
    gap: 10px;
    padding: 0 0 12px;
}

.photo-size-fields__heading p,
.photo-size-fields__note {
    margin: 4px 0 0;
    color: var(--photo-ink-soft);
    font-size: 0.78rem;
    line-height: 1.4;
}

.photo-size-fields__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.photo-size-fields label {
    display: grid;
    gap: 5px;
}

.photo-size-fields label > span {
    color: var(--photo-ink-soft);
    font-size: 0.76rem;
    font-weight: 700;
}

.photo-size-fields input {
    width: 100%;
    min-height: 42px;
    padding: 0 10px;
    border: 1px solid var(--photo-line);
    border-radius: 9px;
    background: #ffffff;
    font: inherit;
}

.photo-field-error {
    margin: 6px 0 0;
    padding: 8px 10px;
    border: 1px solid rgba(198, 79, 74, 0.3);
    border-radius: 9px;
    font-size: 0.78rem;
    line-height: 1.45;
}

.photo-selected-file {
    padding: 10px 12px;
    border-radius: 11px;
    background: var(--photo-surface-soft);
}

.photo-selected-file__heading {
    flex-wrap: wrap;
    align-items: baseline;
}

.photo-selected-file__heading > span {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--photo-ink-soft);
    font-size: 0.74rem;
}

.photo-selected-file__meta,
.photo-result-info dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0 0;
}

.photo-selected-file__meta div,
.photo-result-info dl div {
    min-width: 0;
}

.photo-selected-file__meta dt,
.photo-result-info dt {
    color: var(--photo-ink-soft);
    font-size: 0.7rem;
}

.photo-selected-file__meta dd,
.photo-result-info dd {
    margin: 2px 0 0;
    overflow-wrap: anywhere;
    font-size: 0.76rem;
    font-weight: 700;
}

.photo-check-summary,
.photo-adjust-controls {
    padding: 11px 12px;
    border-radius: 11px;
    background: var(--photo-surface-soft);
}

.photo-vision-status {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(20, 144, 108, 0.2);
    border-radius: 11px;
    background: rgba(20, 144, 108, 0.055);
}

.photo-vision-status__copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.photo-vision-status__copy strong {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--photo-ink);
    font-size: 0.8rem;
}

.photo-vision-status__copy strong::before {
    content: "";
    flex: 0 0 0.72rem;
    width: 0.72rem;
    height: 0.72rem;
    margin-inline-end: 0.35rem;
    border: 2px solid rgba(20, 144, 108, 0.22);
    border-top-color: var(--photo-accent);
    border-radius: 50%;
    opacity: 0;
}

.photo-vision-status.is-loading {
    border-color: rgba(20, 144, 108, 0.42);
    background: rgba(20, 144, 108, 0.08);
}

.photo-vision-status.is-loading .photo-vision-status__copy strong::before {
    opacity: 1;
    animation: photo-vision-spin 0.85s linear infinite;
}

.photo-vision-status__copy span {
    color: var(--photo-accent);
    font-size: 0.7rem;
    font-weight: 800;
}

.photo-vision-status p {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--photo-ink-soft);
    font-size: 0.72rem;
    line-height: 1.4;
}

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

@keyframes photo-core-message-spin {
    to {
        transform: rotate(360deg);
    }
}

.photo-check-summary__heading,
.photo-adjust-controls__heading {
    align-items: center;
}

.photo-check-summary__title,
.photo-adjust-controls__title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.25;
}

.photo-check-summary__title strong,
.photo-adjust-controls__title strong {
    font: inherit;
}

.photo-analysis-list {
    display: grid;
    gap: 5px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.photo-analysis-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--photo-line);
    border-radius: 8px;
    background: #ffffff;
}

.photo-analysis-item__head {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
}

.photo-analysis-item__disclosure {
    flex: 1 1 auto;
    min-width: 0;
}

summary.photo-analysis-item__head {
    cursor: pointer;
    list-style: none;
}

summary.photo-analysis-item__head::-webkit-details-marker {
    display: none;
}

summary.photo-analysis-item__head::before {
    flex: 0 0 auto;
    width: 11px;
    color: var(--photo-ink-soft);
    content: "▸";
    font-size: 0.72rem;
    line-height: 1;
}

.photo-analysis-item__disclosure[open] > summary.photo-analysis-item__head::before {
    content: "▾";
}

.photo-analysis-item__head strong {
    min-width: 0;
    overflow: hidden;
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-analysis-item__status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 23px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
}

.photo-analysis-item__detail {
    margin: 6px 0 0 18px;
    color: var(--photo-ink-soft);
    font-size: 0.72rem;
    line-height: 1.35;
}

.photo-analysis-item__disclosure:not([open]) > .photo-analysis-item__detail,
.photo-analysis-item--unknown > .photo-analysis-item__detail {
    display: none;
}

.photo-analysis-item--pass .photo-analysis-item__status {
    color: var(--photo-accent);
    background: rgba(20, 144, 108, 0.1);
}

.photo-analysis-item--warning .photo-analysis-item__status {
    color: var(--photo-warning);
    background: rgba(197, 125, 23, 0.12);
}

.photo-analysis-item--fail .photo-analysis-item__status {
    color: var(--photo-danger);
    background: rgba(198, 79, 74, 0.1);
}

.photo-analysis-item--unknown .photo-analysis-item__status {
    color: var(--photo-ink-soft);
    background: #eef2f7;
}

.photo-analysis-results__note {
    margin: 8px 0 0;
    color: var(--photo-ink-soft);
    font-size: 0.74rem;
    line-height: 1.45;
}

.photo-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.photo-chip-list li {
    padding: 5px 8px;
    border: 1px solid var(--photo-line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--photo-ink-soft);
    font-size: 0.7rem;
}

.photo-slider-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    margin-top: 10px;
}

.photo-slider-grid label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title output" "range range";
    gap: 2px 8px;
    min-width: 0;
}

.photo-slider-grid label > span {
    grid-area: title;
    color: var(--photo-ink-soft);
    font-size: 0.75rem;
    font-weight: 700;
}

.photo-slider-grid input[type="range"] {
    grid-area: range;
    width: 100%;
    min-height: 40px;
    accent-color: var(--photo-brand);
}

.photo-slider-grid output {
    grid-area: output;
    color: var(--photo-ink);
    font-size: 0.72rem;
    font-weight: 700;
}

.photo-slider-grid input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.photo-details--advanced {
    margin-top: 10px;
    border-bottom: 0;
}

.photo-slider-grid--advanced {
    padding-bottom: 8px;
}

.photo-background-details {
    margin-top: 0;
}

.photo-background-picker {
    padding-bottom: 10px;
}

.photo-background-picker__note {
    margin: 0;
    color: var(--photo-ink-soft);
    font-size: 0.76rem;
    line-height: 1.5;
}

.photo-background-toggle {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: var(--photo-ink);
    font-size: 0.78rem;
    font-weight: 800;
}

.photo-background-toggle input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--photo-brand);
}

.photo-background-toggle input:disabled {
    cursor: not-allowed;
}

.photo-background-picker__status {
    margin: 4px 0 0;
    color: var(--photo-ink-soft);
    font-size: 0.72rem;
    line-height: 1.4;
}

.photo-background-picker__swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.photo-background-picker__button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 9px;
    border: 1px solid var(--photo-line);
    border-radius: 999px;
    background: #ffffff;
    cursor: not-allowed;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.62;
}

.photo-background-picker__swatch {
    width: 14px;
    height: 14px;
    border: 1px solid rgba(19, 34, 53, 0.1);
    border-radius: 999px;
}

.photo-empty-state {
    display: grid;
    gap: 7px;
    padding: 16px;
    border: 1px dashed var(--photo-line);
    border-radius: 11px;
    background: var(--photo-surface-soft);
    color: var(--photo-ink-soft);
    font-size: 0.82rem;
    line-height: 1.45;
}

.photo-empty-state strong {
    color: var(--photo-ink);
    font-size: 0.9rem;
}

.photo-output-mode {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.photo-output-mode legend {
    grid-column: 1 / -1;
    margin-bottom: 1px;
    color: var(--photo-ink-soft);
    font-size: 0.78rem;
    font-weight: 800;
}

.photo-output-mode label {
    position: relative;
    display: block;
    min-width: 0;
    cursor: pointer;
}

.photo-output-mode input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.photo-output-mode label > span {
    display: grid;
    gap: 3px;
    min-height: 58px;
    padding: 10px 11px;
    border: 1px solid var(--photo-line);
    border-radius: 10px;
    background: #ffffff;
}

.photo-output-mode input:checked + span {
    border-color: var(--photo-brand);
    background: var(--photo-brand-soft);
    box-shadow: inset 3px 0 0 var(--photo-brand);
}

.photo-output-mode input:focus-visible + span {
    outline: 3px solid rgba(45, 109, 246, 0.35);
    outline-offset: 2px;
}

.photo-output-mode strong {
    font-size: 0.82rem;
}

.photo-output-mode small {
    color: var(--photo-ink-soft);
    font-size: 0.7rem;
}

.photo-output-mode label.is-unavailable {
    opacity: 0.55;
}

.photo-result-info {
    padding: 11px 12px;
    border-radius: 11px;
    background: var(--photo-surface-soft);
}

.photo-result-info > p {
    margin: 0;
    color: var(--photo-ink-soft);
    font-size: 0.78rem;
    line-height: 1.5;
}

.photo-result-info dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.photo-print-note {
    margin: 0;
    color: var(--photo-ink-soft);
    font-size: 0.74rem;
    line-height: 1.5;
}

.photo-camera-dialog {
    width: min(560px, calc(100% - 24px));
    max-width: 100%;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: #ffffff;
    color: var(--photo-ink);
    box-shadow: 0 24px 70px rgba(10, 28, 48, 0.32);
}

.photo-camera-dialog::backdrop {
    background: rgba(10, 28, 48, 0.64);
}

.photo-camera-dialog__form {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.photo-camera-dialog__header {
    align-items: center;
}

.photo-camera-dialog__title {
    margin: 3px 0 0;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.25;
}

.photo-camera-dialog__title strong {
    font: inherit;
}

.photo-camera-dialog__close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--photo-line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--photo-ink);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.photo-camera-panel__stage {
    position: relative;
    display: grid;
    min-height: 320px;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: #0f1d30;
}

.photo-camera-panel__stage video {
    display: block;
    width: 100%;
    max-height: 62vh;
    object-fit: cover;
    transform: scaleX(-1);
}

.photo-camera-panel__guide {
    position: absolute;
    inset: 18px;
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    pointer-events: none;
}

.photo-camera-panel__guide span {
    position: relative;
    align-self: center;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.7rem;
    font-weight: 700;
}

.photo-camera-panel__guide span::after {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.42);
    content: "";
}

.photo-camera-dialog__empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 20px;
    color: #ffffff;
    text-align: center;
}

.photo-camera-panel__hint {
    margin: 0;
    color: var(--photo-ink-soft);
    font-size: 0.78rem;
    line-height: 1.5;
}

.photo-camera-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.photo-camera-panel__actions .photo-core__button {
    flex: 1 1 180px;
}

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

@container photo-core (max-width: 760px) {
    .photo-core__purpose {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 14px;
        padding: 14px;
    }

    .photo-core__purpose-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .photo-core__traceability {
        grid-template-columns: 1fr;
    }

    .photo-core__traceability-meta {
        grid-template-columns: minmax(0, auto);
    }

    .photo-core__workbench {
        grid-template-columns: 1fr;
        flex: none;
        min-height: 0;
        overflow: visible;
    }

    .photo-core__preview-area {
        min-height: 0;
    }

    .photo-preview-stage {
        min-height: 340px;
    }

    .photo-core__controls {
        min-height: 0;
        overflow: visible;
    }

    .photo-work-panel {
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 792px) {
    .photo-core {
        height: auto;
        min-height: 0;
        display: block;
    }
}

@media (max-width: 520px) {
    .photo-core {
        padding: 14px;
        border-radius: 18px;
    }
}

@container photo-core (min-width: 761px) {
    .photo-core__purpose {
        gap: 12px 18px;
        margin-top: 12px;
        padding: 12px 14px;
    }

    .photo-core__purpose-field input,
    .photo-core__purpose-field select {
        min-height: 44px;
    }

    .photo-core__summary {
        gap: 8px;
        margin-top: 8px;
        padding-top: 6px;
    }

    .photo-core__summary > div {
        padding: 2px 8px;
    }

    .photo-core__summary span {
        margin-bottom: 2px;
        font-size: 0.7rem;
    }

    .photo-core__summary strong {
        font-size: 0.82rem;
    }

    .photo-core__stages {
        margin-top: 8px;
    }

    .photo-stage-nav__option > span {
        min-height: 46px;
        padding-block: 6px;
    }

    .photo-stage-nav__option strong {
        font-size: 0.82rem;
    }

    .photo-stage-nav__option em {
        font-size: 0.68rem;
    }

    .photo-core__workbench {
        margin-top: 10px;
    }

    .photo-core__preview-area {
        padding: 10px;
    }

    .photo-preview-stage {
        min-height: 170px;
        margin-top: 8px;
    }

    .photo-core__preview-meta {
        margin-top: 6px;
    }

    .photo-asset-strip {
        margin-top: 8px;
        padding-top: 7px;
    }

    .photo-asset-list {
        min-height: 58px;
        margin-top: 6px;
    }
}

@container photo-core (max-width: 520px) {
    .photo-core__summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .photo-core__purpose-controls {
        grid-template-columns: 1fr;
    }

    .photo-core__traceability {
        gap: 8px;
        margin-top: 8px;
        padding: 9px 10px;
    }

    .photo-core__traceability-meta {
        gap: 6px;
    }

    .photo-core__workbench {
        display: flex;
        flex-direction: column;
    }

    .photo-core__controls {
        order: 1;
    }

    .photo-core__preview-area {
        order: 2;
    }

    .photo-core[data-active-stage="edit"] .photo-core__controls,
    .photo-core[data-active-stage="result"] .photo-core__controls {
        order: 2;
    }

    .photo-core[data-active-stage="edit"] .photo-core__preview-area,
    .photo-core[data-active-stage="result"] .photo-core__preview-area {
        order: 1;
    }

    .photo-core[data-active-stage="photo"][data-has-asset="false"] .photo-core__preview-area {
        display: none;
    }

    .photo-stage-nav__options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .photo-stage-nav__option > span {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        grid-template-areas: "number" "title";
        row-gap: 2px;
        min-width: 0;
        min-height: 52px;
        padding: 7px 6px;
        justify-items: center;
    }

    .photo-stage-nav__option em {
        display: none;
    }

    .photo-stage-nav__option small {
        font-size: 0.68rem;
    }

    .photo-stage-nav__option strong {
        align-self: start;
        justify-self: center;
        max-width: 100%;
        overflow: hidden;
        font-size: 0.72rem;
        letter-spacing: -0.02em;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .photo-preview-stage {
        min-height: 300px;
    }

    .photo-core__preview-meta {
        display: grid;
        gap: 3px;
    }

    .photo-upload-grid,
    .photo-slider-grid {
        grid-template-columns: 1fr;
    }

    .photo-work-panel__heading {
        display: grid;
        gap: 7px;
    }

    .photo-work-panel__heading > p {
        max-width: none;
        text-align: left;
    }

    .photo-selected-file__meta {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .photo-work-panel__actions {
        margin-inline: -2px;
        padding: 8px 2px 2px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff 28%);
    }

    .photo-work-panel__actions--top {
        padding: 4px 2px 8px;
        background: #ffffff;
    }

    .photo-work-panel__actions--result {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .photo-core__button,
    .photo-upload-card,
    .photo-stage-nav__option > span {
        transition: none;
    }

    .photo-vision-status.is-loading .photo-vision-status__copy strong::before {
        animation: none;
    }

    .photo-core__message.is-loading::before {
        animation: none;
    }

    .photo-core__button:hover:not(:disabled) {
        transform: none;
    }

    .photo-upload-card--primary:has(input:not(:disabled)):hover,
    button.photo-upload-card:hover:not(:disabled) {
        transform: none;
    }
}

@media (max-width: 760px) {
    .photo-home__container {
        width: min(100% - 24px, var(--layout-container-max));
    }

    .photo-home__hero {
        padding: 22px 0 10px;
    }

    .photo-home__value-list,
    .photo-home__flow-grid,
    .photo-home__pillars {
        grid-template-columns: 1fr;
    }

    .photo-home__hero-grid {
        grid-template-columns: 1fr;
    }

    .photo-home__hero-copy h2 {
        font-size: clamp(2rem, 9vw, 3rem);
    }
}

@media (max-width: 520px) {
    .photo-core__summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
