:root {
    color-scheme: light;
    --ink: #202124;
    --muted: #5f6368;
    --line: #d7dbe0;
    --paper: #ffffff;
    --soft: #f5f7f9;
    --accent: #e74f64;
    --accent-ink: #ffffff;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: linear-gradient(135deg, #f7f8fb 0%, #eef5f1 48%, #f8f0f2 100%);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(215, 219, 224, 0.86);
    background: rgba(255, 255, 255, 0.92);
    padding: 12px max(16px, calc((100% - 960px) / 2));
    backdrop-filter: blur(14px);
}

.site-brand {
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.site-menu-toggle,
.site-menu-button,
.site-menu-backdrop,
.site-nav-heading {
    display: none;
}

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

.site-nav a {
    border-radius: 8px;
    color: var(--muted);
    padding: 8px 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    background: color-mix(in srgb, var(--accent) 12%, #ffffff);
    color: var(--accent);
}

.menu-bars-icon {
    display: block;
    width: 18px;
    height: 18px;
}

main {
    width: min(960px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
}

.panel {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(215, 219, 224, 0.9);
    border-radius: 8px;
    padding: clamp(20px, 4vw, 36px);
    box-shadow: 0 16px 44px rgba(45, 52, 64, 0.12);
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(28px, 6vw, 48px);
    line-height: 1.08;
}

h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

.product-logos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(12px, 3vw, 28px);
    align-items: center;
    margin-bottom: 18px;
}

.product-logos img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.single-product-logo {
    grid-template-columns: minmax(0, 1fr);
    width: min(420px, 100%);
}

p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

form {
    display: grid;
    gap: 20px;
    margin-top: 28px;
}

.field {
    display: grid;
    gap: 8px;
}

.field-note {
    font-size: 14px;
    line-height: 1.6;
}

.section-heading-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.section-heading-row h1,
.section-heading-row h2 {
    margin-bottom: 6px;
}

label {
    font-weight: 700;
}

input[type="number"],
input[type="file"],
input[type="text"],
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    padding: 10px 12px;
    font-size: 16px;
}

textarea {
    min-height: 88px;
    resize: vertical;
    font-family: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.howto {
    display: grid;
    gap: 24px;
    margin-top: 28px;
    padding: 24px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.product-howto {
    padding: 18px 0;
}

.howto-copy h2 {
    margin-bottom: 12px;
}

.howto-steps {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 1.4em;
    color: var(--muted);
    line-height: 1.7;
}

.howto-visuals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(16px, 3vw, 28px);
}

.single-howto-visual {
    grid-template-columns: minmax(0, 1fr);
    width: min(420px, 100%);
}

.howto-product {
    display: grid;
    gap: 10px;
    min-width: 0;
    margin: 0;
}

.howto-product img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.howto-product figcaption {
    color: var(--ink);
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.fragrance-page {
    display: grid;
    gap: 24px;
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.fragrance-chat-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 20px;
    align-items: start;
}

.fragrance-chat-panel,
.fragrance-result-panel {
    min-width: 0;
}

.fragrance-chat-log {
    display: grid;
    gap: 12px;
    max-height: 520px;
    min-height: 360px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 14px;
}

.fragrance-message {
    display: grid;
    gap: 4px;
    max-width: 88%;
}

.fragrance-message-user {
    justify-self: end;
}

.fragrance-message-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.fragrance-message p {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
    padding: 10px 12px;
    color: var(--ink);
    line-height: 1.65;
}

.fragrance-message-user p {
    border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
    background: color-mix(in srgb, var(--accent) 10%, #ffffff);
}

.fragrance-chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-top: 12px;
}

.fragrance-chat-form textarea {
    min-height: 64px;
}

.fragrance-chat-note {
    margin-top: 10px;
}

.fragrance-result-panel {
    display: grid;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 18px;
}

.fragrance-result-panel h2,
.fragrance-result-panel h3 {
    margin-bottom: 8px;
}

.fragrance-summary-list {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px 12px;
    margin: 0;
}

.fragrance-summary-list dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.fragrance-summary-list dd {
    min-width: 0;
    margin: 0;
}

.fragrance-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fragrance-pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--soft);
    padding: 3px 8px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.fragrance-recommendations {
    display: grid;
    gap: 10px;
}

.fragrance-recommendation {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.fragrance-recommendation.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(231, 79, 100, 0.12);
}

.fragrance-product-meta,
.fragrance-short-copy {
    font-size: 14px;
    font-weight: 700;
}

.fragrance-reason-sheet {
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.fragrance-safety-note {
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 7%, #ffffff);
    padding: 10px 12px;
    font-size: 13px;
}

button,
.button {
    display: inline-flex;
    width: fit-content;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 10px 18px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.generation-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 12px;
    width: min(520px, 100%);
    align-items: center;
}

.generation-progress[hidden] {
    display: none;
}

.generation-progress-track {
    height: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #edf0f2;
}

.generation-progress-bar {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 180ms ease-out;
}

.generation-progress-value {
    color: var(--muted);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.button-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin-right: 8px;
}

.secondary {
    background: #ffffff;
    color: var(--ink);
    border: 1px solid var(--line);
}

.product-tabs {
    display: flex;
    gap: 4px;
    margin-top: 24px;
    border-bottom: 1px solid var(--line);
}

.product-tab {
    min-height: 46px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    padding: 10px 14px;
}

.product-tab.is-active {
    border-bottom-color: var(--accent);
    color: var(--ink);
}

.result {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
    gap: clamp(24px, 5vw, 48px);
    align-items: start;
    margin-top: 28px;
}

.edit-workspace {
    display: grid;
    grid-template-columns: minmax(100px, 150px) minmax(0, 1fr);
    gap: clamp(18px, 4vw, 36px);
    align-items: start;
}

.edit-workspace.is-profile-mode {
    grid-template-columns: minmax(340px, 1.1fr) minmax(300px, 0.9fr);
}

.edit-workspace.is-stick-mode {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 20px;
}

.result > .edit-workspace:only-child {
    grid-column: 1 / -1;
}

.result.is-profile-mode .edit-workspace {
    grid-column: 1 / -1;
}

.product-preview-pane,
.color-pane {
    min-width: 0;
}

.product-panel {
    min-width: 0;
}

.image-preview {
    display: block;
    width: 100%;
    object-fit: contain;
    border: 1px solid var(--line);
    background: repeating-conic-gradient(#eceff1 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
}

.uploaded-preview {
    max-height: 360px;
    border-radius: 8px;
}

.upload-preview {
    width: min(360px, 100%);
    max-height: 320px;
    border-radius: 8px;
}

.stick-editor {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(90px, 100%);
    aspect-ratio: 1 / 8;
    height: auto;
    border: 1px solid var(--line);
    background: repeating-conic-gradient(#eceff1 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
    overflow: hidden;
    touch-action: none;
}

.stick-editor::after,
.recent-stick-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image: var(--texture-image);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    filter: grayscale(1) contrast(2.2);
    mix-blend-mode: luminosity;
    opacity: 0;
}

.stick-editor.has-texture::after,
.recent-stick-fill.has-texture::after {
    opacity: var(--texture-opacity, 0.2);
}

.profile-card {
    --profile-primary: #e74f64;
    --profile-secondary: #f8d8dd;
    position: relative;
    display: grid;
    grid-template-columns: 36% minmax(0, 1fr);
    width: min(460px, 100%);
    aspect-ratio: 22 / 13;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--profile-primary) 16%, #ffffff), #ffffff 58%),
        #ffffff;
    box-shadow: 0 10px 28px rgba(32, 33, 36, 0.12);
}

.profile-card-canvas {
    display: block;
    width: min(100%, 460px);
    aspect-ratio: 22 / 13;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(32, 33, 36, 0.12);
}

.profile-view-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
    padding: 3px;
}

.profile-view-button {
    width: 100%;
    min-height: 38px;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    padding: 7px 12px;
    font-size: 14px;
    white-space: nowrap;
}

.profile-view-button.is-active {
    background: #ffffff;
    color: var(--ink);
    box-shadow: 0 1px 4px rgba(32, 33, 36, 0.14);
}

.profile-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
    height: 8px;
    background: linear-gradient(90deg, var(--profile-primary), var(--profile-secondary));
}

.profile-card-photo {
    position: relative;
    min-width: 0;
    margin: 26px 0 26px 26px;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    background: color-mix(in srgb, var(--profile-primary) 15%, #edf0f2);
    box-shadow: 0 8px 20px rgba(32, 33, 36, 0.16);
}

.profile-card-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card-photo span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.profile-card-copy {
    position: relative;
    z-index: 1;
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 28px 24px;
}

.profile-card-label {
    color: var(--profile-primary);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
}

.profile-card-name {
    display: -webkit-box;
    overflow-wrap: anywhere;
    overflow: hidden;
    color: var(--ink);
    font-size: clamp(20px, 4vw, 32px);
    font-weight: 800;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.profile-card-message {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.profile-card-palette {
    display: flex;
    height: 22px;
    overflow: hidden;
    border: 2px solid #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(32, 33, 36, 0.12);
}

.profile-card-swatch {
    min-width: 4px;
}

.profile-fields {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.profile-rights-confirmation {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.profile-rights-confirmation p {
    font-size: 13px;
    line-height: 1.6;
}

.profile-rights-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.profile-rights-check input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
}

.acrylic-preview {
    display: grid;
    gap: 8px;
    margin-top: 20px;
}

.acrylic-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    min-height: 260px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(#ffffffcc, #ffffffcc),
        repeating-conic-gradient(#e9edf0 0% 25%, #f8fafb 0% 50%) 50% / 24px 24px;
    cursor: grab;
    touch-action: none;
}

.acrylic-stage:active {
    cursor: grabbing;
}

.acrylic-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.stick-acrylic-stage {
    min-height: 440px;
}

.stick-acrylic-preview {
    width: min(260px, 100%);
    margin-inline: auto;
}

.edit-workspace.is-stick-mode .color-row {
    grid-template-columns: 18px 40px minmax(72px, 1fr) 36px 36px 36px;
    gap: 8px;
}

.edit-workspace.is-stick-mode .chip {
    width: 40px;
    height: 40px;
}

.edit-workspace.is-stick-mode .icon-button {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
}

.model-zoom-controls {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 4;
    display: grid;
    gap: 6px;
}

.model-zoom-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    border: 1px solid rgba(32, 33, 36, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    padding: 0;
    font-size: 24px;
    line-height: 1;
    box-shadow: 0 3px 12px rgba(32, 33, 36, 0.16);
}

.acrylic-caption {
    font-size: 13px;
    line-height: 1.5;
}

.stick-segment {
    position: relative;
    min-height: 18px;
}

.toggle-field {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 8px;
    align-items: center;
    font-weight: 700;
}

.toggle-field input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.range-field {
    display: flex;
    flex: 1 1 260px;
    min-width: 0;
    gap: 12px;
    align-items: center;
    font-weight: 700;
}

.range-field input {
    flex: 1 1 auto;
    min-width: 0;
    accent-color: var(--accent);
}

.gradient-controls {
    grid-column: 1 / -1;
    display: flex;
    gap: 16px;
    align-items: center;
    width: 100%;
    margin-top: 2px;
}

.texture-controls,
.shape-controls {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.texture-controls legend,
.shape-controls legend {
    width: 100%;
    margin-bottom: 2px;
    font-weight: 700;
}

.shape-option {
    display: inline-grid;
    place-items: center;
}

.shape-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.shape-thumb {
    display: block;
    width: 44px;
    height: 52px;
    overflow: hidden;
    border: 2px solid var(--line);
    border-radius: 8px;
    background-color: #ffffff;
    background-image: var(--shape-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 44px auto;
    cursor: pointer;
}

.shape-thumb[data-shape-id="rectangle"],
.shape-thumb[data-shape-id="rounded-rectangle"],
.shape-thumb[data-shape-id="faceted"] {
    background-position: center top 1px;
}

.shape-thumb[data-shape-id="gentle-wave"] {
    background-position: center 39%;
}

.shape-thumb[data-shape-id="capsule-links"],
.shape-thumb[data-shape-id="round-beads"],
.shape-thumb[data-shape-id="flower-scallop"] {
    background-position: center 52%;
}

.shape-option input:checked + .shape-thumb {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(231, 79, 100, 0.18);
}

.texture-option {
    display: inline-grid;
    place-items: center;
}

.texture-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.texture-thumb {
    display: block;
    width: 46px;
    aspect-ratio: 1;
    border: 2px solid var(--line);
    border-radius: 8px;
    background-color: #ffffff;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    cursor: pointer;
}

.texture-thumb-none {
    position: relative;
    background:
        linear-gradient(135deg, transparent calc(50% - 1px), #9aa0a6 calc(50% - 1px), #9aa0a6 calc(50% + 1px), transparent calc(50% + 1px)),
        #ffffff;
}

.texture-option input:checked + .texture-thumb {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(231, 79, 100, 0.18);
}

.texture-strength-field {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
    font-weight: 700;
}

.texture-strength-field input {
    flex: 1 1 auto;
    min-width: 0;
    accent-color: var(--accent);
}

.resize-handle {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    z-index: 2;
    height: 12px;
    cursor: ns-resize;
}

.resize-handle::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 5px;
    width: 44px;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
    transform: translateX(-50%);
}

.color-list {
    display: grid;
    gap: 10px;
}

.color-row {
    display: grid;
    grid-template-columns: 28px 48px minmax(86px, 1fr) 40px 40px 40px;
    gap: 12px;
    align-items: center;
    min-height: 56px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.color-row[draggable="true"] {
    cursor: grab;
}

.color-row.dragging {
    opacity: 0.45;
}

.drag-grip {
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    text-align: center;
}

.chip {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background: transparent;
    cursor: pointer;
}

.color-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(32, 33, 36, 0.48);
}

.color-picker {
    display: grid;
    gap: 16px;
    width: min(420px, 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 20px;
    box-shadow: 0 18px 48px rgba(32, 33, 36, 0.24);
}

.color-picker h3 {
    margin: 0;
    font-size: 22px;
}

.color-picker-preview {
    width: 100%;
    height: 84px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.color-picker-hex {
    min-height: 44px;
}

.color-picker-sliders {
    display: grid;
    gap: 14px;
}

.color-picker-slider {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 72px;
    gap: 10px;
    align-items: center;
}

.color-picker-slider input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.color-picker-slider input[type="number"] {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 16px;
}

.color-picker-actions {
    display: flex;
    justify-content: flex-end;
}

.hex-input {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 15px;
    text-transform: uppercase;
}

.icon-button {
    min-width: 40px;
    width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    border: 1px solid var(--line);
}

.icon-action {
    width: 44px;
    min-width: 44px;
    padding: 0;
}

.icon-action svg {
    width: 22px;
    height: 22px;
}

.icon-action .check-icon {
    display: none;
}

.icon-action.is-copied .copy-icon {
    display: none;
}

.icon-action.is-copied .check-icon {
    display: block;
}

.button:disabled,
.icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

code {
    font-size: 15px;
}

.ratio {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.result-actions {
    margin-top: 28px;
}

.editor-actions {
    margin-top: 14px;
}

.shop-actions {
    margin-top: 18px;
}

.recent-sticks {
    display: grid;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.recent-stick-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 14px;
}

.recent-stick-card {
    display: flex;
    justify-content: center;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    text-decoration: none;
}

.recent-stick-card:hover {
    border-color: var(--accent);
}

.recent-stick-preview {
    display: block;
    width: 34px;
    aspect-ratio: 1 / 8;
    overflow: visible;
}

.recent-stick-fill {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.recent-stick-segment {
    min-height: 1px;
}

.recent-profiles {
    display: grid;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.recent-profile-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.recent-profile-card {
    display: block;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    text-decoration: none;
}

.recent-profile-card:hover {
    border-color: var(--accent);
}

.recent-profile-card > img,
.recent-profile-preview {
    display: block;
    width: 100%;
    aspect-ratio: 22 / 13;
}

.recent-profile-card > img {
    object-fit: cover;
}

.recent-profile-preview {
    display: grid;
    grid-template-columns: 36% minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    background: linear-gradient(135deg, #f5f6f7, #ffffff);
}

.recent-profile-photo {
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: #eef1f3;
    color: var(--muted);
    font-size: 10px;
}

.recent-profile-content {
    display: grid;
    align-content: center;
    gap: 6px;
    min-width: 0;
}

.recent-profile-label {
    color: var(--muted);
    font-size: 8px;
}

.recent-profile-content strong,
.recent-profile-message {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-profile-content strong {
    font-size: 16px;
}

.recent-profile-message {
    color: var(--muted);
    font-size: 11px;
}

.recent-profile-palette {
    display: flex;
    height: 14px;
    margin-top: 4px;
    overflow: hidden;
    border: 1px solid rgba(32, 33, 36, 0.12);
}

.home-recent-sticks {
    margin-top: 24px;
}

.recent-page {
    display: grid;
    gap: 24px;
}

.recent-page-grid {
    margin-top: 0;
}

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-weight: 700;
}

.guide-page {
    display: grid;
    gap: 28px;
}

.guide-section {
    display: grid;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.guide-steps {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 1.4em;
    color: var(--muted);
    line-height: 1.8;
}

.news-page {
    display: grid;
    gap: 24px;
}

.news-list {
    display: grid;
    gap: 14px;
}

.news-item {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 16px;
}

.news-item h2 {
    margin: 0;
}

.news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.news-meta span {
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 12%, #ffffff);
    color: var(--accent);
    padding: 3px 8px;
}

.silhouette-page {
    display: grid;
    gap: 24px;
}

.silhouette-form {
    margin-top: 0;
}

.silhouette-settings {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.silhouette-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 20px;
    align-items: start;
}

.silhouette-editor[hidden] {
    display: none;
}

.silhouette-preview-grid {
    display: grid;
    grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.silhouette-source {
    display: grid;
    gap: 8px;
    min-width: 0;
    margin: 0;
}

.silhouette-source figcaption {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.silhouette-stage-wrap {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(45deg, #eef1f3 25%, transparent 25%),
        linear-gradient(-45deg, #eef1f3 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #eef1f3 75%),
        linear-gradient(-45deg, transparent 75%, #eef1f3 75%),
        #ffffff;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
    background-size: 24px 24px;
}

.silhouette-stage {
    display: block;
    width: 100%;
    max-height: 70vh;
    aspect-ratio: 1;
    touch-action: none;
}

.silhouette-side {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.silhouette-preview-pane {
    min-width: 0;
}

.silhouette-acrylic-stage {
    aspect-ratio: 1;
    min-height: 420px;
}

.silhouette-acrylic-preview {
    max-width: 620px;
    margin-inline: auto;
}

.live-settings {
    grid-template-columns: 1fr;
}

.silhouette-color-row {
    grid-template-columns: 18px 40px minmax(86px, 1fr) 40px 40px 40px;
    gap: 8px;
}

.silhouette-resize-handle {
    fill: rgba(255, 255, 255, 0.01);
    cursor: ns-resize;
}

.silhouette-resize-handle:hover {
    fill: rgba(231, 79, 100, 0.16);
}

.silhouette-zoom-controls {
    right: 12px;
    bottom: 12px;
}

.silhouette-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.silhouette-recent-section {
    margin-top: 24px;
}

.silhouette-recent-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.silhouette-recent-card {
    display: grid;
    width: 100%;
    min-height: 120px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 8px;
}

.silhouette-recent-card svg,
.silhouette-recent-card img {
    display: block;
    width: 100%;
    max-height: 130px;
    object-fit: contain;
}

.share-note {
    min-height: 24px;
    margin-top: 12px;
    font-size: 14px;
}

.share-note:empty {
    display: none;
}

.share-link {
    margin-top: 16px;
}

.error {
    color: #9b1c31;
    background: #fff1f3;
    border: 1px solid #f0b8c1;
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 20px;
}

.prepared-article {
    display: grid;
    gap: 28px;
}

.eyebrow {
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
}

.article-note {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 14px 16px;
}

.article-note strong {
    color: var(--ink);
}

.prepared-toc {
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 18px;
}

.prepared-toc h2,
.prepared-toc h3 {
    margin: 0;
}

.prepared-toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.prepared-toc-section {
    display: grid;
    gap: 8px;
    align-content: start;
    min-width: 0;
}

.prepared-toc-section h3 {
    font-size: 16px;
}

.prepared-toc-section ol {
    display: grid;
    gap: 4px;
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 14px;
}

.prepared-toc a {
    color: inherit;
    text-decoration: none;
}

.prepared-toc a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.prepared-group {
    display: grid;
    gap: 16px;
    scroll-margin-top: 20px;
}

.prepared-category {
    display: grid;
    gap: 22px;
    scroll-margin-top: 20px;
}

.prepared-category > h2 {
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.prepared-group-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: baseline;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.prepared-group-heading span {
    color: var(--muted);
    font-size: 14px;
}

.prepared-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.prepared-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 14px;
    scroll-margin-top: 20px;
}

.prepared-stick {
    display: flex;
    width: 34px;
    aspect-ratio: 1 / 8;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid rgba(32, 33, 36, 0.22);
}

.prepared-stick span,
.prepared-palette span {
    display: block;
    flex: 1 1 0;
}

.prepared-card-body {
    display: grid;
    gap: 10px;
    align-content: start;
    min-width: 0;
}

.prepared-card-body h3,
.prepared-card-body h4 {
    margin: 0;
    font-size: 20px;
}

.prepared-palette {
    display: flex;
    height: 22px;
    overflow: hidden;
    border: 1px solid rgba(32, 33, 36, 0.12);
}

.prepared-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 900px) {
    .site-header {
        flex-wrap: nowrap;
        padding: 12px 16px;
    }

    .site-menu-button {
        display: inline-grid;
        width: 42px;
        height: 42px;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #ffffff;
        color: var(--ink);
        cursor: pointer;
    }

    .site-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 30;
        background: rgba(32, 33, 36, 0.36);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease;
    }

    .site-nav {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 31;
        display: flex;
        width: min(82vw, 320px);
        height: 100vh;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 4px;
        overflow-y: auto;
        border-right: 1px solid var(--line);
        background: #ffffff;
        padding: 18px;
        box-shadow: 18px 0 34px rgba(32, 33, 36, 0.18);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .site-menu-toggle:checked ~ .site-menu-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .site-menu-toggle:checked ~ .site-nav {
        transform: translateX(0);
    }

    .site-nav-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 8px;
        color: var(--ink);
        font-size: 18px;
        font-weight: 800;
    }

    .site-menu-close {
        display: grid;
        width: 40px;
        height: 40px;
        place-items: center;
        border-radius: 8px;
        color: var(--muted);
        cursor: pointer;
        font-size: 30px;
        line-height: 1;
    }

    .site-menu-close:hover {
        background: var(--soft);
        color: var(--ink);
    }

    .site-nav a {
        padding: 12px 10px;
    }

    main {
        width: min(100% - 24px, 960px);
        padding: 20px 0;
    }

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

    .uploaded-preview {
        max-height: 280px;
    }

    .edit-workspace {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 14px;
    }

    .product-tabs {
        overflow-x: auto;
    }

    .product-tab {
        flex: 0 0 auto;
        font-size: 14px;
        padding-inline: 10px;
    }

    .profile-card {
        grid-template-columns: 38% minmax(0, 1fr);
    }

    .profile-card-photo {
        margin: 18px 0 18px 18px;
        border-width: 3px;
    }

    .profile-card-copy {
        gap: 5px;
        padding: 20px 14px;
    }

    .profile-card-name {
        font-size: clamp(16px, 5vw, 24px);
    }

    .profile-card-message {
        font-size: 11px;
        -webkit-line-clamp: 2;
    }

    .profile-card-palette {
        height: 16px;
    }

    .profile-fields {
        gap: 10px;
    }

    .acrylic-stage {
        min-height: 220px;
    }

    .stick-acrylic-stage {
        min-height: 400px;
    }

    .silhouette-acrylic-stage {
        min-height: 360px;
    }

    .edit-workspace.is-profile-mode {
        grid-template-columns: minmax(0, 1fr);
    }

    .edit-workspace.is-stick-mode {
        grid-template-columns: minmax(0, 1fr);
    }

    .stick-editor {
        width: 72px;
    }

    .color-row {
        grid-template-columns: 18px 38px minmax(0, 1fr) 34px 34px 34px;
        gap: 8px;
    }

    .silhouette-color-row {
        grid-template-columns: 18px 38px minmax(0, 1fr) 34px 34px 34px;
    }

    .chip {
        width: 38px;
        height: 38px;
    }

    .hex-input {
        font-size: 14px;
        padding-inline: 8px;
    }

    .icon-button {
        width: 34px;
        min-width: 34px;
        min-height: 34px;
    }

    .drag-grip {
        font-size: 16px;
    }

    .result-actions {
        gap: 10px;
    }

    .howto-visuals {
        grid-template-columns: 1fr;
    }

    .silhouette-settings,
    .silhouette-editor,
    .silhouette-preview-grid,
    .fragrance-chat-shell {
        grid-template-columns: 1fr;
    }

    .silhouette-stage {
        max-height: 58vh;
    }

    .fragrance-chat-form {
        grid-template-columns: 1fr;
    }

    .fragrance-chat-form button {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .profile-card-photo {
        margin: 12px 0 12px 12px;
    }

    .profile-card-copy {
        padding: 14px 10px;
    }

    .profile-card-label {
        font-size: 8px;
    }

    .profile-fields input,
    .profile-fields textarea {
        font-size: 14px;
    }

    .acrylic-stage {
        min-height: 190px;
    }

    .stick-acrylic-stage {
        min-height: 360px;
    }

    .silhouette-acrylic-stage {
        min-height: 320px;
    }
}

/* iro.js integration tweaks */
.color-popover {
    position: fixed;
    z-index: 2147483646;
    max-width: calc(100vw - 24px);
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(32, 33, 36, 0.24);
}

.iro-container {
    position: fixed;
}
.iro-actions {
    display: flex;
    gap: 8px;
}
.iro-container .pcr-app {
    z-index: 2147483647 !important;
}
.iro-container {
    box-shadow: 0 18px 48px rgba(32, 33, 36, 0.24);
    background: #ffffff;
    border-radius: 8px;
    padding: 12px;
}
