.welcome-sample {
    margin-bottom: 28px;
    min-width: 0;
}

.welcome-sample h2 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 650;
}

.welcome-sample :focus-visible {
    outline: 2px solid #475569;
    outline-offset: 3px;
}

.welcome-dialog {
    width: min(460px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 24px;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    color: #334155;
    box-shadow: 0 24px 80px #0f172a40;
}

.welcome-dialog::backdrop {
    background: #0f172abf;
}

.welcome-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.welcome-dialog-header h2 {
    font-size: 1.05rem;
    color: #0f172a;
}

.welcome-dialog-header button {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 1.4rem;
    cursor: pointer;
}

.welcome-dialog p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* First-creation guide and the compact, shared text explorer. */
.create-guide {
    margin-bottom: 20px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    color: #334155;
}
.create-guide [hidden], .text-ideas-dialog [hidden] { display: none !important; }
.create-guide-topline, .guide-footer, .overlay-text-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.create-guide-topline { margin-bottom: 20px; font-size: .75rem; color: #64748b; }
.create-guide h2 { font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.35; color: #1e293b; }
.create-guide p { font-size: .9rem; line-height: 1.6; margin: 10px 0 18px; }
.guide-welcome { margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid #e2e8f0; }
.create-guide .guide-welcome h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.35rem); font-weight: 800; line-height: 1.2; letter-spacing: -.025em; }
.create-guide .guide-welcome p { margin-bottom: 0; }
.guide-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.guide-primary, .guide-secondary, .guide-link, .guide-answer, .text-idea-option {
    font: inherit;
    cursor: pointer;
    border-radius: 8px;
    line-height: 1.4;
}
.guide-primary, .guide-secondary { padding: 11px 16px; font-size: .85rem; font-weight: 600; min-height: 44px; }
.guide-primary { background: #1f2937; color: #fff; border: 1px solid #1f2937; }
.guide-primary:hover { background: #111827; }
.guide-primary:disabled { opacity: .55; cursor: wait; }
.guide-secondary { background: #fff; color: #334155; border: 1px solid #cbd5e1; }
.guide-secondary:hover, .guide-secondary[aria-expanded="true"] { background: #f1f5f9; border-color: #64748b; }
.guide-link { padding: 6px 0; border: 0; background: transparent; color: #1f2937; font-size: .8rem; text-decoration: underline; text-underline-offset: 3px; }
.guide-footer { margin-top: 20px; }
.guide-note, .create-guide .guide-note { font-size: .8rem; color: #64748b; line-height: 1.5; }
.guide-note:empty { display: none; }
.create-guide label, .text-ideas-dialog label { display: block; margin: 15px 0 7px; font-size: .85rem; font-weight: 600; }
.create-guide textarea, .text-ideas-dialog textarea {
    display: block; width: 100%; box-sizing: border-box; padding: 12px;
    font: inherit; font-size: .9rem; line-height: 1.5; color: #1e293b;
    background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; resize: vertical;
}
.guide-answers { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.guide-answer { padding: 5px 9px; background: #fff; color: #475569; border: 1px solid #e2e8f0; font-size: .72rem; }
.guide-style-preview { display: flex; gap: 18px; align-items: center; margin: 18px 0; }
.guide-style-preview img { width: 150px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.guide-style-preview h3 { margin: 0; font-size: 1rem; color: #1e293b; }
.guide-style-preview p { margin: 6px 0; font-size: .8rem; }
.guide-review { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: .85rem; }
.guide-review dt { font-weight: 600; }
.guide-review dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 110px; overflow: auto; }
.overlay-text-label { width: 100%; }
.overlay-text-label label { margin-bottom: 5px; }
.text-ideas-trigger {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; padding: 0; border: 1px solid #e2e8f0;
    border-radius: 7px; background: #fff; cursor: pointer; font-size: 16px;
}
.text-ideas-trigger:hover { background: #f1f5f9; border-color: #94a3b8; }
.text-ideas-dialog { width: min(500px, calc(100vw - 32px)); }
.text-ideas-dialog h2 { margin: 0; }
#text-ideas-submit { margin-top: 12px; }
#text-ideas-results { display: grid; gap: 8px; }
.text-idea-option { padding: 12px 14px; background: #f8fafc; border: 1px solid #e2e8f0; color: #1e293b; text-align: left; font-size: .9rem; overflow-wrap: anywhere; }
.text-idea-option:hover { background: #f1f5f9; border-color: #64748b; }
.text-ideas-dialog :focus-visible, .text-ideas-trigger:focus-visible { outline: 2px solid #475569; outline-offset: 3px; }
@media (max-width: 600px) {
    .create-guide { padding: 20px; }
    .guide-buttons { flex-direction: column; }
    .guide-style-preview { flex-direction: column; align-items: stretch; }
    .guide-style-preview img { width: 100%; }
    .text-ideas-trigger { width: 36px; height: 36px; }
}

.welcome-sample > .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.guide-review-image { display: block; width: 80px; height: 56px; object-fit: cover; border-radius: 6px; margin-bottom: 6px; }

.guide-help {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}
.guide-examples summary {
    cursor: pointer;
    color: #1f2937;
    font-size: .8rem;
    padding: 6px 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.guide-examples[open] { flex-basis: 100%; }
.guide-example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.guide-example-grid figure { margin: 0; min-width: 0; }
.guide-example-grid figcaption { margin-top: 6px; color: #64748b; font-size: .75rem; line-height: 1.4; }
.guide-example-grid img { display: block; width: 100%; height: auto; border-radius: 8px; }
.guide-examples-heading { margin: 16px 0 0; font-size: 1rem; font-weight: 700; line-height: 1.4; color: #1e293b; }
.guide-return { display: none; }
@media (max-width: 768px) {
    .custom-container.has-create-guide > .content-container { order: 1; }
    .custom-container.has-create-guide > .sidebar-container { order: 2; }
    .custom-container.guide-active.guide-form-open .guide-return { display: inline-block; margin-bottom: 16px; }
}
@media (max-width: 480px) {
    .guide-help { gap: 6px 16px; }
    .guide-example-grid { grid-template-columns: 1fr; gap: 16px; }
}
.guide-secondary[aria-pressed="true"] { background: #f1f5f9; border-color: #64748b; }
#text-ideas-context { margin-top: 16px; }
#text-ideas-context summary { font-size: .8rem; color: #475569; cursor: pointer; }
