@charset "UTF-8";

/*
 * Reusable feed writer. Load after shared/assets/layout.css.
 * Editor helpers are limited to .feed-editor-host; modal styles to .f-composer.
 */

.feed-editor-host .f-avatar {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: var(--theme-soft,#eeeff1);
    overflow: hidden;
    color: var(--theme-muted,#a0a5ab);
    font-size: calc(14px * var(--app-font-scale, 1));
    font-weight: 700;
}

.feed-editor-host .f-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feed-editor-host .f-list-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px 10px;
    color: var(--theme-muted,#9298a1);
    font-size: calc(12px * var(--app-font-scale, 1));
    text-align: center;
    line-height: 1.7;
}

.feed-editor-host .f-spinner {
    width: 15px;
    height: 15px;
    border: 1.5px solid var(--theme-border,#dde0e4);
    border-top-color: var(--theme-ink,#5b626d);
    border-radius: 50%;
    display: inline-block;
    animation: feed-writer-spin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes feed-writer-spin {
    to {
        transform: rotate(360deg);
    }
}

.feed-editor-host .f-empty {
    padding: 70px 24px 60px;
    text-align: center;
}

.feed-editor-host .f-empty>.f-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 20px;
    color: var(--theme-subtle,#b5bac0);
}

.feed-editor-host .f-empty h2 {
    font-size: calc(19px * var(--app-font-scale, 1));
    letter-spacing: -.5px;
    line-height: 1.5;
    margin: 0 0 10px;
}

.feed-editor-host .f-empty p {
    font-size: calc(12px * var(--app-font-scale, 1));
    line-height: 1.8;
    color: var(--theme-muted,#969ca5);
    margin: 0 auto 24px;
    max-width: 270px;
}

.feed-editor-host .f-empty .f-button {
    font-size: calc(12px * var(--app-font-scale, 1));
}

.feed-editor-host .f-empty-note {
    font-size: calc(12px * var(--app-font-scale, 1));
    line-height: 1.7;
    text-align: center;
    color: var(--theme-muted,#969ca5);
}

.feed-editor-host .f-editor-author {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 24px;
}

.feed-editor-host .f-editor-author strong {
    font-size: calc(14px * var(--app-font-scale, 1));
}

/* Writing is a content canvas, separate from boxed account/transaction forms. */
.feed-editor-host.f-editor-page { max-width: 640px; }
.feed-editor-host form.f-editor.ui-form { padding: 0; border: 0; border-radius: 0; background: transparent; }
.feed-editor-host .f-editor-heading { margin-bottom: 24px; }
.feed-editor-host .f-editor-heading h1 { font-size: calc(22px * var(--app-font-scale, 1)); line-height: 1.4; letter-spacing: -.04em; }
.feed-editor-host .f-editor-text { padding: 4px 0 4px 12px; margin-left: -14px; border-left: 2px solid transparent; }
.feed-editor-host .f-editor-text:focus-within { border-left-color: var(--app-border); }
.feed-editor-host .f-editor #feed-content {
    display: block; width: 100%; height: clamp(200px,32dvh,340px); min-height: 200px; max-height: none;
    padding: 0; margin: 0; border: 0; border-radius: 0; background: transparent; color: var(--app-ink);
    font: 400 calc(16px * var(--app-font-scale, 1))/1.85 var(--app-font); resize: vertical; box-shadow: none;
}
.feed-editor-host .f-editor #feed-content:focus-visible { outline: none; }
.feed-editor-host .f-editor #feed-content::placeholder { color: var(--app-subtle); }
.feed-editor-host .f-tags-hint { margin: 12px 0 0; color: var(--app-muted); font-size: calc(12px * var(--app-font-scale, 1)); line-height: 1.7; }
.feed-editor-host .f-editor-count { margin: 10px 0 16px; color: var(--app-subtle); font-size: calc(11px * var(--app-font-scale, 1)); }
.feed-editor-host #feed-add-photos { min-height: 44px; padding: 8px 0; font-size: calc(14px * var(--app-font-scale, 1)); font-weight: 600; }
.feed-editor-host .f-editor-tools > .ui-field-count { margin: 0; font-size: calc(12px * var(--app-font-scale, 1)); }
.feed-editor-host .f-photo-help { margin-top: 8px; color: var(--app-muted); font-size: calc(12px * var(--app-font-scale, 1)); line-height: 1.7; }
.feed-editor-host .f-editor-actions.ui-form-actions { margin-top: 28px; padding-top: 0; border-top: 0; gap: 12px; }
.feed-editor-host .f-editor-actions > :first-child { min-width: 64px; padding-inline: 12px; }
.feed-editor-host .f-editor-actions #feed-publish { flex: 1; min-height: 48px; border-radius: 12px; font-size: calc(14px * var(--app-font-scale, 1)); }
.feed-editor-host #feed-publish > .ui-icon { display: none; }

.feed-editor-host .f-editor-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 17px;
    border-top: 1px solid var(--f-line);
}

.feed-editor-host .f-photo-editor {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 10px;
    padding: 0 0 22px;
}

.feed-editor-host .f-photo-tile {
    position: relative;
    border: 1px solid var(--theme-line,#edeff1);
    background: var(--theme-soft,#f7f8f9);
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
}

.feed-editor-host .f-photo-tile>img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feed-editor-host .f-photo-remove {
    position: absolute;
    right: 5px;
    top: 5px;
    min-width: 25px;
    min-height: 25px;
    padding: 5px;
    background: var(--theme-glass,#fffffff2);
    box-shadow: 0 1px 5px #00000012;
}

.feed-editor-host .f-photo-remove .f-icon {
    width: 15px;
    height: 15px;
    flex-basis: 15px;
}

.feed-editor-host .f-photo-order {
    display: flex;
    position: absolute;
    left: 5px;
    bottom: 5px;
    gap: 3px;
}

.feed-editor-host .f-photo-order .f-icon-button {
    min-width: 23px;
    min-height: 23px;
    padding: 4px;
    background: var(--theme-glass,#ffffffed);
}

.feed-editor-host .f-photo-order .f-icon {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
}

.feed-editor-host .f-photo-number {
    position: absolute;
    left: 7px;
    top: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 4px;
    border-radius: 50%;
    background: #22262cb3;
    color: #fff;
    font-size: calc(9px * var(--app-font-scale, 1));
    font-weight: 700;
}

.feed-editor-host.f-editor-page>.f-empty {
    padding-top: 75px;
}

@media(max-width:640px) {

    .feed-editor-host .f-avatar {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .feed-editor-host .f-editor-author {
        margin-bottom: 20px;
    }

    .feed-editor-host .f-editor-author strong {
        font-size: calc(14px * var(--app-font-scale, 1));
    }

    .feed-editor-host .f-editor-tools {
        padding-top: 13px;
    }

    .feed-editor-host .f-photo-editor {
        gap: 7px;
    }

    .feed-editor-host .f-empty {
        padding: 65px 15px 50px;
    }

    .feed-editor-host .f-empty h2 {
        font-size: calc(18px * var(--app-font-scale, 1));
    }

    .feed-editor-host .f-empty p {
        font-size: calc(11px * var(--app-font-scale, 1));
    }
}

/* The composer is a native top-layer dialog. Its shape grows from the clicked control. */

.f-composer {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--theme-surface,#fff);
    color: var(--f-ink);
    overflow: hidden;
    overscroll-behavior: contain;
    will-change: clip-path;
    isolation: isolate;
}

.f-composer::backdrop {
    background: rgb(20 24 30 / 8%);
}

.f-composer > .f-composer-surface {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    padding: max(var(--app-page-top), env(safe-area-inset-top)) var(--app-page-inset) max(40px, env(safe-area-inset-bottom));
    background: var(--theme-surface,#fff);
    -webkit-overflow-scrolling: touch;
}

.f-composer .f-toast {
    left: 50%;
    bottom: max(28px, env(safe-area-inset-bottom));
}

html.f-composer-open {
    overscroll-behavior: none;
}

@media (max-width: 640px) {
    .f-composer > .f-composer-surface {
        padding: max(var(--app-page-top), env(safe-area-inset-top)) var(--app-page-inset) max(28px, env(safe-area-inset-bottom));
        scrollbar-gutter: auto;
    }

    .f-composer .f-toast {
        bottom: max(24px, env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    .f-composer {
        will-change: auto;
    }
}
