/* Page /creer: guided, single-column creation flow. */
body.creator-page {
    --create-ink: #142322;
    --create-muted: #61706e;
    --create-line: #eadfd5;
    --create-paper: #fffdf9;
    --create-soft: #f1faf6;
    --create-teal: #178c80;
    --create-teal-dark: #0b625b;
    --create-teal-soft: #ddf5ef;
    --create-coral: #ff5b52;
    --create-coral-soft: #ffe9e3;
    --create-gold: #f3bf55;
    --create-shadow: 0 16px 38px rgba(42, 54, 48, 0.09);
    background:
        radial-gradient(circle at 8% 0%, rgba(255, 91, 82, 0.08), transparent 28%),
        linear-gradient(180deg, #f7efe6 0%, #f6efe8 42%, #eaf6f2 100%);
    color: var(--create-ink);
}

body.creator-page main {
    width: min(650px, calc(100% - 20px));
    overflow: clip;
}

body.creator-page .site-header,
body.creator-page main,
body.creator-page .site-footer {
    max-width: 650px;
}

body.creator-page .site-header {
    display: flex;
    flex-direction: row;
    align-items: center;
}

body.creator-page .nav-actions {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
}

body.creator-page .menu-button {
    display: grid;
    width: 34px;
    height: 34px;
    place-content: center;
    gap: 5px;
    border: 1px solid #eadfd5;
    border-radius: 12px;
    background: #fff8ef;
}

body.creator-page .menu-button span {
    width: 18px;
    height: 2px;
}

body.creator-page .creator-hero,
body.creator-page .creator-workbench {
    width: auto;
    margin: 0;
}

body.creator-page .creator-hero {
    padding: 18px 18px 12px;
}

body.creator-page .creation-plan {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 20px;
    padding: 6px;
    border: 1px solid #eee3da;
    border-radius: 8px;
    background: rgba(255, 253, 249, 0.94);
}

@media (min-width: 520px) {
    body.creator-page .creation-plan {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

body.creator-page .creation-plan span {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    padding: 8px 3px;
    border-radius: 7px;
    color: #687673;
    font-size: 0.66rem;
    font-weight: 900;
    line-height: 1;
}

body.creator-page .creation-plan b {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #edf4f1;
    color: var(--create-teal-dark);
    font-size: 0.72rem;
}

body.creator-page .creation-plan .is-active {
    background: var(--create-teal-soft);
    color: var(--create-teal-dark);
}

body.creator-page .creation-plan .is-active b {
    background: var(--create-teal);
    color: #fff;
}

body.creator-page .creator-intro {
    display: grid;
    gap: 8px;
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
}

body.creator-page .eyebrow {
    margin: 0;
    color: var(--create-coral);
    font-size: 0.7rem;
    font-weight: 950;
    letter-spacing: 0;
    text-transform: uppercase;
}

body.creator-page .creator-hero h1 {
    max-width: 560px;
    margin: 0 auto;
    font-size: clamp(1.85rem, 8vw, 2.55rem);
    line-height: 1.02;
}

body.creator-page .creator-hero p:not(.eyebrow) {
    max-width: 500px;
    margin: 0 auto;
    color: var(--create-muted);
    font-size: 0.96rem;
    line-height: 1.45;
}

body.creator-page .creator-workbench {
    padding: 0 14px 24px;
}

body.creator-page .editor-form {
    display: grid;
    grid-template-columns: 1fr !important;
    grid-auto-flow: row;
    gap: 12px;
    max-width: 560px;
    margin: 0 auto;
}

body.creator-page .work-card {
    grid-column: 1 !important;
    grid-row: auto !important;
    min-width: 0;
    margin: 0;
    padding: 15px;
    border: 1px solid var(--create-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--create-shadow);
}

body.creator-page .paste-card {
    border-color: #bfe6de;
    background:
        linear-gradient(180deg, rgba(221, 245, 239, 0.82), rgba(255, 255, 255, 0.97) 44%),
        #fff;
}

body.creator-page .card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

body.creator-page .card-title-row > div {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

body.creator-page .card-title-row h2 {
    margin: 0;
    color: var(--create-ink);
    font-size: 1.03rem;
    line-height: 1.12;
}

body.creator-page .card-title-row p {
    margin-top: 3px;
    color: var(--create-muted);
    font-size: 0.78rem;
    line-height: 1.32;
}

body.creator-page .card-index {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 8px;
    background: var(--create-teal);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 950;
}

body.creator-page .help-dot,
body.creator-page .ai-badge {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    min-width: 28px;
    height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--create-teal-soft);
    color: var(--create-teal-dark);
    font-size: 0.74rem;
    font-weight: 950;
}

body.creator-page .ai-badge {
    background: #fff2d9;
    color: #8d5d11;
}

body.creator-page .type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

body.creator-page .type-tile {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-areas:
        "icon title"
        "icon text";
    gap: 2px 9px;
    min-width: 0;
    min-height: 74px;
    padding: 10px;
    border: 1px solid #ebe2d8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

body.creator-page .type-tile input,
body.creator-page .module-tile input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

body.creator-page .type-icon {
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #fff2e9;
    font-size: 1.08rem;
    line-height: 1;
}

body.creator-page .type-tile strong {
    grid-area: title;
    min-width: 0;
    color: var(--create-ink);
    font-size: 0.82rem;
    font-weight: 950;
    line-height: 1.12;
}

body.creator-page .type-tile small {
    grid-area: text;
    display: block;
    min-width: 0;
    color: var(--create-muted);
    font-size: 0.68rem;
    line-height: 1.2;
}

body.creator-page .type-tile:has(input:checked),
body.creator-page .module-tile:has(input:checked) {
    border-color: var(--create-teal);
    background: #f4fcf9;
    box-shadow: 0 0 0 3px rgba(23, 140, 128, 0.13), 0 10px 22px rgba(42, 54, 48, 0.07);
}

body.creator-page .type-tile:hover,
body.creator-page .module-tile:hover {
    transform: translateY(-1px);
}

body.creator-page .paste-shell {
    overflow: hidden;
    border: 1.5px dashed #76bfb4;
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(23, 140, 128, 0.05) 1px, transparent 1px),
        linear-gradient(180deg, rgba(23, 140, 128, 0.05) 1px, transparent 1px),
        var(--create-paper);
    background-size: 22px 22px;
}

body.creator-page .paste-toolbar {
    display: flex;
    gap: 6px;
    padding: 10px 10px 0;
    flex-wrap: wrap;
}

body.creator-page .paste-toolbar span {
    min-height: 24px;
    padding: 4px 9px;
    border: 1px solid #d7ece8;
    border-radius: 999px;
    background: #fff;
    color: var(--create-teal-dark);
    font-size: 0.68rem;
    font-weight: 950;
}

body.creator-page .paste-zone {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 0;
    background: transparent;
}

body.creator-page .paste-zone > span {
    color: var(--create-muted);
    font-size: 0.72rem;
    font-weight: 950;
    text-transform: uppercase;
}

body.creator-page textarea {
    min-height: 230px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--create-ink);
    font-size: 0.91rem;
    font-weight: 700;
    line-height: 1.48;
    resize: vertical;
    box-shadow: none;
}

body.creator-page textarea:focus {
    outline: 0;
    box-shadow: none;
    transform: none;
}

body.creator-page .input-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    color: var(--create-muted);
    font-size: 0.75rem;
    font-weight: 800;
}

body.creator-page .input-footer > span:first-child {
    min-width: 0;
}

body.creator-page .input-footer > span:last-child {
    flex: 0 0 auto;
}

body.creator-page .ai-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

body.creator-page .button.button-ai,
body.creator-page button.button-ai {
    width: 100%;
    min-height: 48px;
    gap: 8px;
    border-color: var(--create-teal) !important;
    border-radius: 10px;
    background: var(--create-teal) !important;
    background-color: var(--create-teal) !important;
    color: #fff !important;
    box-shadow: 0 14px 26px rgba(23, 140, 128, 0.24);
    font-size: 0.92rem;
}

body.creator-page .button.button-ai:hover,
body.creator-page button.button-ai:hover {
    border-color: var(--create-teal-dark) !important;
    background: var(--create-teal-dark) !important;
    background-color: var(--create-teal-dark) !important;
}

body.creator-page .button.button-ai:disabled,
body.creator-page button.button-ai:disabled {
    cursor: wait;
    opacity: 0.82;
    transform: none;
}

body.creator-page .text-button {
    justify-self: center;
    border: 0;
    background: transparent;
    color: var(--create-coral);
    font-size: 0.78rem;
    font-weight: 950;
    cursor: pointer;
}

body.creator-page .fact-fields {
    display: grid;
    gap: 10px;
}

body.creator-page .fact-fields label {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-areas:
        "icon label"
        "icon input";
    gap: 5px 10px;
    align-items: center;
    min-width: 0;
    padding: 11px;
    border: 1px solid #eee4da;
    border-radius: 8px;
    background: #fffaf3;
}

body.creator-page .field-icon {
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #fff;
    box-shadow: inset 0 0 0 1px #efe4d9;
    font-size: 1rem;
}

body.creator-page .field-label {
    grid-area: label;
    color: #30403f;
    font-size: 0.76rem;
    font-weight: 950;
}

body.creator-page input,
body.creator-page select {
    min-width: 0;
    min-height: 42px;
    padding: 8px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--create-ink);
    font-size: 0.96rem;
    font-weight: 850;
    box-shadow: none;
}

body.creator-page .fact-fields input {
    grid-area: input;
}

body.creator-page input:focus,
body.creator-page select:focus {
    outline: 0;
    box-shadow: none;
    transform: none;
}

body.creator-page .fact-fields label:focus-within {
    border-color: var(--create-teal);
    box-shadow: 0 0 0 3px rgba(23, 140, 128, 0.12);
}

body.creator-page .structured-list {
    display: grid;
    gap: 8px;
}

body.creator-page .structured-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 10px;
    border: 1px solid #eee5dc;
    border-radius: 8px;
    background: #fff;
}

body.creator-page .structured-row > span {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--create-teal-soft);
    font-size: 1rem;
}

body.creator-page .structured-row > span img {
    display: block;
    width: 34px;
    height: 34px;
}

body.creator-page .structured-row div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

body.creator-page .structured-row strong {
    min-width: 0;
    color: var(--create-ink);
    font-size: 0.86rem;
    font-weight: 950;
    line-height: 1.1;
}

body.creator-page .structured-row small {
    min-width: 0;
    color: var(--create-muted);
    font-size: 0.76rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

body.creator-page .module-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

body.creator-page .module-tile {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    min-height: 70px;
    padding: 10px;
    border: 1px solid #ebe2d8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

body.creator-page .module-tile > span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--create-soft);
}

body.creator-page .module-tile > span img {
    display: block;
    width: 36px;
    height: 36px;
}

body.creator-page .module-tile div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

body.creator-page .module-tile strong {
    color: var(--create-ink);
    font-size: 0.86rem;
    font-weight: 950;
    line-height: 1.1;
}

body.creator-page .module-tile small {
    color: var(--create-muted);
    font-size: 0.73rem;
    line-height: 1.28;
}

body.creator-page .module-tile em {
    display: none;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--create-teal);
    color: #fff;
    font-size: 0.66rem;
    font-style: normal;
    font-weight: 950;
}

body.creator-page .module-tile:has(input:checked) em {
    display: inline-grid;
}

body.creator-page .privacy-card {
    display: grid;
    gap: 12px;
}

body.creator-page .privacy-toggle {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid #ebe2d8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

body.creator-page .privacy-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

body.creator-page .privacy-switch {
    position: relative;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: #e9ded4;
    box-shadow: inset 0 0 0 1px #d9cec4;
    transition: background 0.18s ease, box-shadow 0.18s ease;
}

body.creator-page .privacy-switch::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(42, 54, 48, 0.16);
    transition: transform 0.18s ease;
}

body.creator-page .privacy-toggle:has(input:checked) {
    border-color: var(--create-teal);
    background: #f4fcf9;
    box-shadow: 0 0 0 3px rgba(23, 140, 128, 0.12);
}

body.creator-page .privacy-toggle:has(input:checked) .privacy-switch {
    background: var(--create-teal);
    box-shadow: inset 0 0 0 1px var(--create-teal);
}

body.creator-page .privacy-toggle:has(input:checked) .privacy-switch::after {
    transform: translateX(20px);
}

body.creator-page .privacy-toggle strong,
body.creator-page .privacy-toggle small {
    display: block;
    min-width: 0;
}

body.creator-page .privacy-toggle strong {
    color: var(--create-ink);
    font-size: 0.9rem;
    font-weight: 950;
}

body.creator-page .privacy-toggle small {
    margin-top: 3px;
    color: var(--create-muted);
    font-size: 0.74rem;
    line-height: 1.32;
}

body.creator-page .access-code-field {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-areas:
        "icon label"
        "icon input";
    gap: 5px 10px;
    align-items: center;
    min-width: 0;
    padding: 11px;
    border: 1px solid #eee4da;
    border-radius: 8px;
    background: #fffaf3;
}

body.creator-page .access-code-field input {
    grid-area: input;
    letter-spacing: 0.18em;
}

body.creator-page .access-code-field.is-disabled {
    opacity: 0.58;
}

body.creator-page .access-code-field:focus-within {
    border-color: var(--create-teal);
    box-shadow: 0 0 0 3px rgba(23, 140, 128, 0.12);
}

body.creator-page .sticky-actions {
    display: grid;
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
    gap: 9px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

body.creator-page .sticky-actions .button {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    border-radius: 8px;
    font-size: 0.9rem;
}

body.creator-page .button-secondary {
    background: #fff !important;
    background-color: #fff !important;
    border-color: #e1d8cf !important;
    color: var(--create-ink) !important;
    -webkit-text-fill-color: var(--create-ink);
    box-shadow: none;
}

body.creator-page .danger-zone {
    width: auto;
    max-width: 560px;
    margin: 14px auto 0;
    padding: 0 14px;
}

@media (min-width: 560px) {
    body.creator-page .creator-hero {
        padding: 22px 24px 14px;
    }

    body.creator-page .creator-workbench {
        padding: 0 22px 28px;
    }

    body.creator-page .type-grid {
        grid-template-columns: 1fr;
    }

    body.creator-page .fact-fields {
        grid-template-columns: 1fr;
    }

    body.creator-page .fact-fields label:first-child,
    body.creator-page .fact-fields label:last-child {
        grid-column: auto;
    }
}

@media (max-width: 380px) {
    body.creator-page .type-grid {
        grid-template-columns: 1fr;
    }

    body.creator-page .sticky-actions {
        grid-template-columns: 1fr;
    }

    body.creator-page .module-tile {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    body.creator-page .module-tile em {
        grid-column: 2;
        justify-self: start;
    }
}
