.fatd-panel {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    width: min(1200px, calc(100vw - 32px));
    max-width: none;
    margin: 24px 0 40px;
    color: #28183a;
    font-family: inherit;
}
.fatd-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: clamp(12px, 2vw, 22px) clamp(18px, 3.5vw, 44px);
    border-radius: 22px;
    background:
        radial-gradient(ellipse at 79% 31%, #9761cc, transparent 57%),
        radial-gradient(ellipse at 95% 100%, #6b3297, transparent 42%),
        linear-gradient(120deg, #25113d, #512277);
    box-shadow: 0 16px 38px #37164d29;
    color: #fff;
    overflow: hidden;
}
.fatd-kicker { color: #6a3c91; font-size: .83rem; font-weight: 700; }
.fatd-hero .fatd-kicker { color: #f3ddff; }
.fatd-hero .fatd-kicker span { color: #ffd78b; }
.fatd-hero h1 { margin: 12px 0 10px; color: #fff; font-size: clamp(1.4rem, 3.8vw, 3rem); line-height: 1.3; white-space: nowrap; }
.fatd-hero p { max-width: 38em; margin: 0; color: #fbf2ff; line-height: 1.7; }
.fatd-illustration {
    display: block;
    width: 100%;
    height: clamp(150px, 18vw, 225px);
    justify-self: center;
    filter: drop-shadow(0 12px 20px #27103c40);
}
.fatd-editor {
    margin-top: 16px;
    padding: clamp(14px, 3vw, 28px);
    border: 1px solid #e1d2f1;
    border-radius: 18px;
    background: #fcf9ff;
    box-shadow: 0 12px 35px #39205814;
}
.fatd-editor-header, .fatd-editor-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.fatd-editor-label { margin: 3px 0 0; color: #321749; font-size: 1.3rem; }
.fatd-divider { display: flex; align-items: center; gap: 9px; margin: 14px 0; color: #8b54b1; font-size: 12px; }
.fatd-divider::before, .fatd-divider::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, #e7d5fa, #ad70d1); }
.fatd-divider::after { transform: scaleX(-1); }
.fatd-text {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 220px;
    margin: 10px 0 0;
    padding: 14px;
    border: 1px solid #ab96c5;
    border-radius: 10px;
    background: #fff;
    color: #28183a;
    font: inherit;
    line-height: 1.7;
    resize: vertical;
}
.fatd-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.fatd-actions button, .fatd-tools button {
    min-height: 44px;
    padding: 7px 12px;
    border: 1px solid #d9c3ed;
    border-radius: 8px;
    background: #fff;
    color: #512687;
    font: inherit;
    cursor: pointer;
}
.fatd-tools button {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    box-sizing: border-box;
    width: 44px;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}
.fatd-tools svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fatd-actions .fatd-speak { background: #512687; border-color: #512687; color: #fff; }
.fatd-panel :focus-visible { outline: 3px solid #7851a9; outline-offset: 2px; }
.fatd-panel button:disabled { opacity: .5; cursor: default; }
.fatd-editor-footer { margin-top: 9px; font-size: .875rem; }
.fatd-status { min-height: 1.5em; margin: 0; }
.fatd-count { color: #5d397f; }
@media (max-width: 600px) {
    .fatd-panel { width: calc(100vw - 20px); margin-top: 14px; }
    .fatd-hero { grid-template-columns: minmax(0, 1fr); text-align: center; gap: 3px; }
    .fatd-illustration { height: clamp(106px, 31vw, 150px); }
    .fatd-text { font-size: max(16px, 1rem); }
}
.fatd-page { width: 100%; }
.fatd-editor-label { font-weight: 750; }
.fatd-tools {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    overflow-x: auto;
    padding: 4px;
}
.fatd-color {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    box-sizing: border-box;
    height: 44px;
    margin: 0;
    border: 1px solid #d9c3ed;
    border-radius: 8px;
    background: #fff;
}
.fatd-color input { width: 30px; height: 30px; padding: 2px; cursor: pointer; }
.fatd-writing-area { position: relative; padding-top: 17px; }
.fatd-writing-area::before, .fatd-writing-area::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 5px;
    width: clamp(66px, 15vw, 156px);
    aspect-ratio: 220 / 156;
    background: url("vines.svg") no-repeat center / contain;
    pointer-events: none;
}
.fatd-writing-area::before { left: -3px; }
.fatd-writing-area::after { right: -3px; transform: scaleX(-1); }
.fatd-text { padding: 42px clamp(28px, 7vw, 78px) 18px; overflow-wrap: anywhere; white-space: pre-wrap; resize: none; }
.fatd-text:empty::before { content: attr(data-placeholder); color: #705987; pointer-events: none; }
@media (max-width: 600px) {
    .fatd-text { padding: 35px 25px 16px; }
}
.fatd-actions .fatd-poetry { background: #fff0d5; border-color: #d7ab69; color: #59365d; }
.fatd-poetry-tip { margin: 10px 0 0; color: #593e72; font-size: .9rem; line-height: 1.7; }
.fatd-editor-frame {
    min-height: 220px;
    margin-top: 10px;
    border: 1px solid #ab96c5;
    border-radius: 10px;
    background: #fff;
}
.fatd-editor-frame .fatd-text {
    margin-top: 0;
    border: 0;
    background: transparent;
}
.fatd-editor-frame .fatd-has-preview { min-height: 0; padding-bottom: 4px; }
.fatd-text.fatd-has-preview:empty::before { content: none; }
.fatd-live-preview {
    padding: 0 clamp(28px, 7vw, 78px) 18px;
    color: #705987;
    line-height: 1.7;
    overflow-wrap: anywhere;
}
.fatd-live-preview[hidden] { display: none; }
.fatd-preview-poetry { text-align: center; }
.fatd-preview-title { font-size: 2em; font-weight: 700; line-height: 1.4; }
@media (max-width: 600px) {
    .fatd-live-preview { padding-inline: 25px; }
}

.fatd-has-poem-preview [data-poem-body],
.fatd-has-prose-preview > [data-prose-body]:last-child {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.fatd-live-preview { white-space: pre-wrap; }

[data-prose-body] > p,
.fatd-live-preview:not(.fatd-preview-poetry) p {
    margin: 0;
}

[data-prose-body] > p + p,
.fatd-live-preview:not(.fatd-preview-poetry) p + p {
    margin-top: .8em;
}
