/* Form grid, field metadata, word counts, and error messages. */

.form-grid {
    display: grid;
    gap: 1.1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-meta {
    display: flex;
    min-height: 1.3rem;
    margin-top: 0.3rem;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
}

.field-meta__count {
    margin-left: auto;
    color: var(--color-muted);
    font-size: 0.73rem;
    white-space: nowrap;
}

.field-meta__count--over-limit {
    color: var(--color-error);
    font-weight: 700;
}

.field-error {
    min-height: 0;
    margin: 0.3rem 0 0;
    color: var(--color-error);
    font-size: 0.78rem;
    font-weight: 650;
}

.field-error:empty {
    display: none;
}

/* Saved draft recovery banner — mirrors the brief-import card pattern */
.draft-banner {
    display: flex;
    min-height: 4.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    align-items: center;
    gap: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-brand);
    border-radius: var(--radius-sm);
}

.draft-banner[hidden] {
    display: none;
}

.draft-banner > img {
    width: 3rem;
    height: 3rem;
    flex: 0 0 auto;
}

.draft-banner__content {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.draft-banner__title {
    color: var(--color-ink);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.draft-banner__message {
    color: var(--color-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.draft-banner__actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex: 0 0 auto;
}

.draft-banner__action {
    position: relative;
    display: inline-flex;
    min-height: 1.75rem;
    padding: 0.25rem 0.42rem;
    color: var(--color-muted);
    background: transparent;
    border: 0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    gap: 0.28rem;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.draft-banner__action:hover {
    color: var(--color-ink);
    background: #e1e7ec;
}

.draft-banner__action--icon-only {
    width: 1.75rem;
    padding: 0;
}

.draft-banner__action-icon {
    width: 0.88rem;
    height: 0.88rem;
    flex: none;
}

.draft-banner__action[data-tooltip]::after {
    position: absolute;
    z-index: 6;
    right: 0;
    bottom: calc(100% + 0.4rem);
    width: max-content;
    max-width: 12rem;
    padding: 0.3rem 0.45rem;
    color: #fff;
    background: var(--color-ink);
    border-radius: 3px;
    content: attr(data-tooltip);
    font-size: 0.68rem;
    font-weight: 400;
    line-height: 1.2;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.2rem);
    transition: opacity 120ms ease, transform 120ms ease;
    white-space: normal;
}

.draft-banner__action[data-tooltip]:is(:hover, :focus-visible)::after {
    opacity: 1;
    transform: translateY(0);
}
