/* Posts: unified list of WordPress drafts, SAT drafts and published posts. */
#posts-view .posts-toolbar,
#posts-view .posts-filters,
#posts-view .posts-card-actions,
#posts-view .posts-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
#posts-view .posts-toolbar { margin: 12px 0; }
#posts-view .posts-filters { margin: 16px 0; }
#posts-view .posts-filters label { font-weight: 600; }
#posts-view .posts-filters label.posts-checkbox { font-weight: 400; display: inline-flex; gap: 6px; align-items: center; }
/* Sort by and its list stay together when the filters wrap onto a second line. */
#posts-view .posts-sort-group { display: inline-flex; align-items: center; gap: 8px; }
#posts-view .posts-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
#posts-view .posts-card {
    padding: 14px 16px;
    border: 1px solid var(--sat-card-border, #8ba4bd);
    border-left-width: 6px;
    border-radius: 8px;
    background: var(--sat-card-background, #f1f6fb);
}
#posts-view .posts-card:focus-within { border-color: var(--sat-card-active-border, #2563a6); }
#posts-view .posts-card.posts-kind-wordpress_draft { border-left-color: #b45309; }
#posts-view .posts-card.posts-kind-sat_draft { border-left-color: #6d28d9; }
#posts-view .posts-card.posts-kind-published { border-left-color: #15803d; }
#posts-view .posts-card h3 { margin: 0 0 8px; overflow-wrap: anywhere; }
#posts-view .posts-card h3:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
#posts-view .posts-card-meta { margin: 8px 0; color: #475569; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
#posts-view .posts-card-actions { margin-top: 8px; }
#posts-view .posts-update-unavailable { color: #475569; font-size: 13px; }

/* Every badge carries visible text; colour is supplementary. */
#posts-view .posts-badge {
    display: inline-flex;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #e2e8f0;
    color: #334155;
    border-color: #94a3b8;
}
#posts-view .posts-badge-label { font-weight: 400; }
#posts-view .posts-type-wordpress_draft { background: #ffedd5; color: #9a3412; border-color: #fdba74; }
#posts-view .posts-type-sat_draft { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
#posts-view .posts-type-published { background: #dcfce7; color: #166534; border-color: #86efac; }
#posts-view .posts-status-draft,
#posts-view .posts-status-pending { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
#posts-view .posts-status-in_review { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }
#posts-view .posts-status-approved { background: #ccfbf1; color: #115e59; border-color: #5eead4; }
#posts-view .posts-status-scheduled { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
#posts-view .posts-status-published,
#posts-view .posts-status-updated { background: #dcfce7; color: #166534; border-color: #86efac; }
#posts-view .posts-status-published_awaiting_import { background: #ecfccb; color: #3f6212; border-color: #bef264; }
#posts-view .posts-status-out_of_sync { background: #ffedd5; color: #9a3412; border-color: #fdba74; }
#posts-view .posts-status-missing,
#posts-view .posts-status-trash { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
#posts-view .posts-status-archived,
#posts-view .posts-status-private,
#posts-view .posts-status-unknown { background: #e5e7eb; color: #374151; border-color: #9ca3af; }
#posts-view .posts-accuracy-critical { background: #fce7f3; color: #9d174d; border-color: #f9a8d4; }
#posts-view .posts-tasks-complete { background: #dcfce7; color: #166534; border-color: #86efac; }
#posts-view .posts-bing-indexed { background: #cffafe; color: #155e75; border-color: #67e8f9; }
#posts-view .posts-bing-search { text-decoration: none; font-weight: 700; min-width: 2.5em; text-align: center; }
#posts-view .posts-bing-tick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
#posts-view .posts-bing-message { color: #991b1b; }
#posts-view .posts-bing-message:empty { display: none; }
#posts-view .posts-google-controls { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#posts-view .posts-google-indexed { background: #e0e7ff; color: #3730a3; border-color: #a5b4fc; }
#posts-view .posts-google-search { text-decoration: none; font-weight: 700; min-width: 2.5em; text-align: center; }
#posts-view .posts-google-tick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
#posts-view .posts-google-message { color: #991b1b; }
#posts-view .posts-google-message:empty { display: none; }
#posts-view .posts-check-controls { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#posts-view .posts-check-tick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
#posts-view .posts-check-message { color: #991b1b; }
#posts-view .posts-check-message:empty { display: none; }
#posts-view .posts-classification { margin-top: 10px; }

/* Add Image panel under a post's card. Main actions use the dark button style; secondary ones are outlined but full size. */
#posts-view .post-image-panel { margin-top: 12px; padding: 14px; border: 1px solid #94a3b8; border-radius: 8px; background: #ffffff; display: grid; gap: 12px; position: relative; }
#posts-view .post-image-panel > h3 { margin: 0; padding-right: 90px; font-size: 17px; }
#posts-view .post-image-panel > .post-image-secondary:first-of-type { position: absolute; top: 12px; right: 12px; }
#posts-view .post-image-panel button { padding: 8px 14px; border: 0; border-radius: 4px; background: #16324f; color: #ffffff; font-size: 14px; font-weight: 600; cursor: pointer; }
#posts-view .post-image-panel button:hover:not(:disabled) { background: #204465; }
#posts-view .post-image-panel button:disabled { opacity: 0.5; cursor: not-allowed; }
#posts-view .post-image-panel button:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
#posts-view .post-image-panel button.post-image-secondary { background: #ffffff; color: #16324f; border: 1px solid #16324f; }
#posts-view .post-image-panel button.post-image-secondary:hover:not(:disabled) { background: #eef2f7; }
#posts-view .post-image-step { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid #e2e8f0; }
#posts-view .post-image-step h4 { margin: 0; font-size: 15px; }
#posts-view .post-image-step h5 { margin: 6px 0 0; font-size: 14px; }
#posts-view .post-image-places { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
#posts-view .post-image-choice { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; overflow-wrap: anywhere; }
#posts-view .post-image-choice input { margin-top: 3px; flex: 0 0 auto; }
#posts-view .post-image-sources { display: flex; flex-wrap: wrap; gap: 8px; }
#posts-view .post-image-panel button.post-image-source { background: #ffffff; color: #16324f; border: 2px solid #16324f; }
#posts-view .post-image-panel button.post-image-source-on { background: #16324f; color: #ffffff; }
#posts-view .post-image-source-box { display: grid; gap: 8px; justify-items: start; }
#posts-view .post-image-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; width: 100%; }
#posts-view .post-image-form label { display: grid; gap: 4px; font-weight: 600; flex: 1 1 260px; }
#posts-view .post-image-form input, #posts-view .post-image-source-box > label input { padding: 7px 9px; border: 1px solid #94a3b8; border-radius: 4px; font: inherit; font-weight: 400; width: 100%; box-sizing: border-box; }
#posts-view .post-image-source-box > label { display: grid; gap: 4px; font-weight: 600; width: 100%; }
#posts-view .post-image-prompt { width: 100%; }
#posts-view .post-image-prompt summary { cursor: pointer; color: #16324f; font-weight: 600; }
#posts-view .post-image-prompt textarea { display: block; width: 100%; box-sizing: border-box; margin: 6px 0; padding: 8px; border: 1px solid #94a3b8; border-radius: 4px; font: inherit; }
#posts-view .post-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; width: 100%; }
#posts-view .post-image-item { margin: 0; display: grid; gap: 4px; align-content: start; font-size: 12px; overflow-wrap: anywhere; }
#posts-view .post-image-item img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; background: #f1f5f9; }
#posts-view .post-image-item figcaption { display: grid; gap: 2px; }
#posts-view .post-image-item-title { font-weight: 600; }
#posts-view .post-image-result { margin: 0; display: grid; gap: 4px; max-width: 560px; }
#posts-view .post-image-result img { width: 100%; height: auto; border-radius: 4px; background: #f1f5f9; }
#posts-view .post-image-result figcaption, #posts-view .post-image-note { color: #475569; font-size: 13px; margin: 0; }
#posts-view .post-image-detail { margin: 0; }
#posts-view .post-image-summary { margin: 0; padding: 8px 10px; border-radius: 4px; background: #eff6ff; border: 1px solid #93c5fd; }
#posts-view .post-image-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#posts-view .post-image-running { margin: 0; font-weight: 600; }
#posts-view .post-image-failed { margin: 0; color: #b91c1c; }
#posts-view .post-image-ok { margin: 0; padding: 8px 10px; border-radius: 4px; background: #f0fdf4; border: 1px solid #22c55e; color: #14532d; }
#posts-view .post-image-warn { margin: 0; padding: 8px 10px; border-radius: 4px; background: #fffbeb; border: 1px solid #f59e0b; color: #78350f; }
#posts-view .post-image-warn p, #posts-view .post-image-warn ul { margin: 4px 0; }

@media (max-width: 640px) {
    #posts-view .posts-filters { flex-direction: column; align-items: stretch; }
    #posts-view .posts-sort-group { flex-direction: column; align-items: stretch; }
    #posts-view .posts-card-actions .accuracy-button { flex: 1 1 100%; }
    #posts-view .posts-card-actions .posts-bing-search { flex: 0 0 auto; }
    #posts-view .posts-card-actions .posts-google-search { flex: 0 0 auto; }
    #posts-view .post-image-panel > .post-image-secondary:first-of-type { position: static; justify-self: end; order: -1; }
    #posts-view .post-image-panel > h3 { padding-right: 0; }
    #posts-view .post-image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #posts-view .post-image-actions button, #posts-view .post-image-sources button { flex: 1 1 100%; }
}

/* Remove on a SAT-written draft (owner, 7 November 2026): same size as the other card buttons, in the shared red
   outline so it is never mistaken for a main action; the text stays readable on hover. */
#posts-view .posts-card-actions .accuracy-button.posts-remove-button {
    background: #ffffff; color: #b42318; box-shadow: inset 0 0 0 1px #b42318;
}
#posts-view .posts-card-actions .accuracy-button.posts-remove-button:hover:not(:disabled),
#posts-view .posts-card-actions .accuracy-button.posts-remove-button:focus-visible {
    background: #b42318; color: #ffffff;
}
