/* Anchored pop-out editor for small manual-review fields (Subject/Sender/Name/Address). */

/* Hide the underlying field's text while it's being edited in the pop-out, so
   it doesn't ghost through behind the floating editor. */
.field-popout-source-active {
    color: transparent;
    caret-color: transparent;
}

/* Hide the original header while its text animates onto the pop-out (visibility,
   not display, so the card layout doesn't shift). */
.field-popout-header-hidden {
    visibility: hidden;
}

.field-popout-editor {
    position: fixed;
    z-index: 10050;
    box-sizing: border-box;
    /* width/left/top/height are set inline from the anchored field's rect. */
    opacity: 0;
    transform: scale(0.97);
    transform-origin: top left;
    transition: opacity 0.12s ease, transform 0.12s ease, width 0.12s ease, left 0.12s ease;
    pointer-events: none;
}

.field-popout-editor.is-open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.field-popout-editor-input {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 10px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #1f2937;
    background: #ffffff;
    border: 1px solid #1a7f7f;
    border-radius: 8px;
    /* Stand the editor off the page with its own elevation + soft teal ring,
       rather than dimming everything behind it. */
    box-shadow: 0 0 0 4px rgba(26, 127, 127, 0.15), 0 12px 32px rgba(0, 0, 0, 0.28);
    outline: none;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

/* On close, fade/shrink just the box so the label stays visible while it flies
   back onto the original header. */
.field-popout-editor.is-closing .field-popout-editor-input {
    opacity: 0;
    transform: scale(0.96);
}

.field-popout-editor-input:focus {
    border-color: #1a7f7f;
    box-shadow: 0 0 0 4px rgba(26, 127, 127, 0.22), 0 12px 32px rgba(0, 0, 0, 0.3);
}

.field-popout-editor-label {
    position: absolute;
    top: -10px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 8px;
    font-family: 'Inter', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 18px;
    color: #1a7f7f;
    background: #ffffff;
    border-radius: 999px;
    white-space: nowrap;
    pointer-events: none;
    /* Scale during the FLIP pivots from the text start so it lines up with the
       header at both ends of the animation. */
    transform-origin: top left;
}

.field-popout-editor-label i {
    font-size: 11px;
}

/* Length meter (Subject/Sender) floated at the top-right, mirroring the label. */
.field-popout-editor-meter {
    position: absolute;
    top: -11px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #ffffff;
    border-radius: 999px;
    pointer-events: none;
}

/* No empty pill while the meter is hidden (short values). */
.field-popout-editor-meter:has(.hidden-element) {
    display: none;
}
