/* ===================================================================
   Benchmark Graphéine — main stylesheet
   =================================================================== */

@font-face {
    font-family: 'Grapheine Season';
    src: url('/assets/fonts/Grapheine-SeasonVF.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: block;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: #fafafa;
    color: #111;
    font-family: 'Grapheine Season', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
    background: #d4d4d4; border-radius: 10px;
    border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #a3a3a3; border: 2px solid transparent; background-clip: padding-box; }

/* ---- Top bar ---- */
/* Chrome-only banner — sticks above the topbar, dismissible */
.bm-chrome-warn {
    background: #fff8e1;
    border-bottom: 1px solid #f0d88a;
    color: #5a4a00;
    padding: 10px 24px;
    font-size: 13px; line-height: 1.4;
    display: flex; align-items: center; gap: 16px;
    justify-content: space-between;
}
.bm-chrome-warn a {
    color: #5a4a00; text-decoration: underline; font-weight: 600;
}
.bm-chrome-warn-close {
    background: transparent; border: none; cursor: pointer;
    color: #5a4a00; font-size: 20px; line-height: 1;
    padding: 0 4px;
}
.bm-chrome-warn-close:hover { color: #111; }

.topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 24px;
    background: white;
    border-bottom: 1px solid #e5e5e5;
    position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-logo { width: 26px; height: 26px; display: block; flex: 0 0 26px; }
.brand-name { font-size: 16px; font-weight: 700; }
.brand-sub { font-size: 13px; color: #999; }
.brand-version {
    font-size: 10px; color: #c0c0c0; font-weight: 400;
    padding: 2px 5px; border: 1px solid #eee; border-radius: 3px;
    margin-left: 4px; letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}
.spacer { flex: 1; }

.nav-link {
    padding: 6px 10px; font-size: 13px; color: #555;
    border-radius: 6px;
}
.nav-link:hover { background: #f3f3f3; }

.btn-primary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: #111; color: white;
    border: none; border-radius: 6px;
    font-size: 13px; font-weight: 500;
    cursor: pointer;
}
.btn-primary:hover { background: #000; }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-ghost {
    padding: 6px 10px;
    background: white; color: #555;
    border: 1px solid #e5e5e5; border-radius: 6px;
    font-size: 13px; cursor: pointer;
}
.btn-ghost:hover { background: #f9f9f9; }

.link-underline { text-decoration: underline; color: #111; font-weight: 500; }

/* ---- Login screen ---- */
.login-wrap {
    min-height: 100vh; display: grid; place-items: center;
    padding: 24px;
}
.login-form {
    width: 100%; max-width: 360px;
    background: white; padding: 32px;
    border-radius: 8px; border: 1px solid #e5e5e5;
}
.field-label {
    display: block;
    font-size: 11px; color: #888;
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e5e5; border-radius: 6px;
    font-size: 14px; outline: none;
    background: white;
}
.input:focus { border-color: #111; }
.error-box {
    margin-top: 16px; padding: 8px 12px;
    background: #fee; color: #b91c1c;
    font-size: 13px; border-radius: 4px;
}
.success-box {
    margin-top: 16px; padding: 8px 12px;
    background: #ecfdf5; color: #059669;
    font-size: 13px; border-radius: 4px;
}

/* ---- Gallery ---- */
.gallery-wrap { max-width: 1400px; margin: 0 auto; padding: 24px 24px 80px; }

.filters-row {
    display: flex; gap: 12px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.search-input { position: relative; flex: 1 1 260px; min-width: 220px; }

/* Inline "✨ IA" badge that appears in the search input when the query
   has 4+ words (heuristic for switching to semantic search mode). */
.search-mode-badge {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 10px; font-weight: 500;
    padding: 3px 8px;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: white;
    border-radius: 999px;
    letter-spacing: 0.03em;
    pointer-events: none;
    box-shadow: 0 1px 2px rgba(124,58,237,0.3);
}

/* Small spinner shown while the AI request is in flight. Replaces the
   badge (both are position: absolute at the same anchor). */
.search-loader {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px;
    border: 2px solid #e5e5e5;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: search-spin 700ms linear infinite;
}
@keyframes search-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Active AI query chip in the filter row — same "chip-active" shape but
   with the purple gradient so it's obviously the IA query. */
.chip-active.chip-ai {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    max-width: 380px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.selection-bar { display: flex; gap: 8px; align-items: center; }
.selection-count { font-size: 13px; color: #555; }

/* --- Gallery display modes --- */

/* View switcher (group of 3 mode buttons) */
.view-switcher {
    display: inline-flex;
    border: 1px solid #e5e5e5; border-radius: 6px;
    overflow: hidden; background: white;
}
.view-switcher .view-btn {
    border: none; background: transparent;
    padding: 6px 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #888; transition: background 100ms, color 100ms;
}
.view-switcher .view-btn + .view-btn { border-left: 1px solid #e5e5e5; }
.view-switcher .view-btn:hover { background: #fafafa; color: #111; }
.view-switcher .view-btn.active { background: #111; color: white; }

/* --- Filter popovers (categories / expertises) --- */
.filter-popover { position: relative; }
.filter-btn {
    display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid #e5e5e5; background: white;
    border-radius: 6px; padding: 6px 12px;
    font-size: 13px; color: #111; cursor: pointer;
    font-family: inherit;
}
.filter-btn:hover { background: #fafafa; }
.filter-btn.active { background: #111; color: white; border-color: #111; }
.filter-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; border-radius: 999px;
    background: #111; color: white; font-size: 10px; font-weight: 600;
    padding: 0 5px; margin-left: 4px;
}
.filter-btn.active .filter-badge { background: white; color: #111; }

.filter-popover-panel {
    display: none;
    position: absolute; top: calc(100% + 4px); left: 0; z-index: 100;
    background: white; border: 1px solid #e5e5e5; border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 8px; min-width: 280px; max-width: 420px;
    max-height: 320px; overflow-y: auto;
    flex-wrap: wrap; gap: 4px;
}
.filter-popover.open .filter-popover-panel { display: flex; }

.filter-pill {
    display: inline-flex; align-items: center;
    border: 1px solid #e5e5e5; background: white;
    border-radius: 999px;
    padding: 4px 10px; font-size: 12px;
    color: #111; cursor: pointer; font-family: inherit;
    text-decoration: none;
}
.filter-pill:hover { background: #fafafa; }
.filter-pill.selected {
    background: #111; color: white; border-color: #111;
}

/* --- Active filter chips + top-20 tag suggestions row --- */
.filter-chips-row {
    display: flex; flex-wrap: wrap; gap: 6px;
    align-items: center;
    margin-bottom: 20px;
    font-size: 12px;
}
.chip-active {
    display: inline-flex; align-items: center; gap: 6px;
    background: #111; color: white;
    border-radius: 999px;
    padding: 3px 4px 3px 10px;
    text-decoration: none;
    font-size: 12px;
}
.chip-active span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 999px;
    background: rgba(255,255,255,0.2);
    font-size: 12px; line-height: 1;
}
.chip-active:hover span { background: rgba(255,255,255,0.35); }

.chip-sep {
    color: #888; font-size: 11px;
    margin-left: 4px; margin-right: 2px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.chip-suggest {
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid #e5e5e5; background: white;
    border-radius: 999px;
    padding: 2px 8px 2px 10px;
    font-size: 11px;
    color: #666; text-decoration: none;
    transition: background 100ms, color 100ms, border-color 100ms;
}
.chip-suggest:hover {
    background: #111; color: white; border-color: #111;
}
.chip-suggest:hover .chip-suggest-count {
    background: rgba(255,255,255,0.2); color: white;
}
.chip-suggest-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 16px; height: 14px; padding: 0 4px;
    background: #f0f0f0; color: #888;
    border-radius: 999px;
    font-size: 9px; font-weight: 500;
    transition: background 100ms, color 100ms;
}

/* --- "Tous les tags" toggle button (chip-shaped, dashed) --- */
.chip-toggle-all {
    display: inline-block;
    border: 1px dashed #b5b5b5; background: transparent;
    border-radius: 999px;
    padding: 2px 10px; font-size: 11px;
    color: #555; text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    margin-left: 4px;
    transition: background 100ms, color 100ms, border-color 100ms;
}
.chip-toggle-all:hover { background: #f5f5f5; color: #111; border-color: #999; }
.chip-toggle-all[aria-expanded="true"] { background: #111; color: white; border-color: #111; border-style: solid; }

/* --- All-tags expandable panel --- */
.all-tags-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease;
    margin-bottom: 20px;
}
.all-tags-panel[hidden] { display: none; }
.all-tags-panel.expanded {
    max-height: 500px;
    overflow-y: auto;
    padding: 12px 14px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 6px;
}
.all-tags-search-wrap {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
    position: sticky; top: 0;
    background: #fafafa;
    padding-bottom: 6px;
    z-index: 2;
}
.all-tags-search {
    flex: 1;
    font-size: 12px;
    padding: 5px 10px;
}
.all-tags-count {
    font-size: 10px; color: #888;
    white-space: nowrap;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.all-tags-grid {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.all-tag-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: white; border: 1px solid #e5e5e5;
    border-radius: 999px;
    padding: 3px 8px 3px 10px;
    font-size: 11px; color: #444;
    text-decoration: none;
    transition: background 100ms, color 100ms, border-color 100ms;
}
.all-tag-chip:hover { background: #111; color: white; border-color: #111; }
.all-tag-chip:hover .all-tag-count { background: rgba(255,255,255,0.2); color: white; }
.all-tag-chip.selected {
    background: #111; color: white; border-color: #111;
}
.all-tag-chip.selected .all-tag-count { background: rgba(255,255,255,0.2); color: white; }
.all-tag-chip.hidden { display: none; }
.all-tag-label { }
.all-tag-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 15px; padding: 0 4px;
    background: #f0f0f0; color: #888;
    border-radius: 999px;
    font-size: 9px; font-weight: 500;
}

/* --- Quality filter in the top filter bar --- */
.filter-quality {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 3px 8px;
    background: white; border: 1px solid #e5e5e5;
    border-radius: 5px;
    height: 28px;
}
.filter-quality .quality-star {
    display: inline-block;
    width: 18px; height: 18px; line-height: 18px;
    text-align: center;
    color: #ddd;
    font-size: 14px;
    text-decoration: none;
    transition: color 100ms, transform 100ms;
}
.filter-quality .quality-star:hover { transform: scale(1.15); color: #999; }
.filter-quality .quality-star.on { color: #fbbf24; }         /* filled up to selected level */
.filter-quality .quality-star.on:hover { color: #f59e0b; }
.filter-quality .quality-star.active { color: #f59e0b; }     /* the currently-set boundary */

/* --- Quality badge on gallery cards --- */
/* Positioned bottom-right of the hero: top-right is taken by the delete
   button (visible on hover), top-left by the selection checkbox. */
.card-quality {
    position: absolute;
    bottom: 8px; right: 8px;
    display: inline-flex; gap: 1px;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    padding: 3px 6px;
    border-radius: 999px;
    z-index: 3;
    pointer-events: none;
    backdrop-filter: blur(2px);
}
.card-quality .q-star {
    font-size: 10px; line-height: 1;
    color: rgba(255, 255, 255, 0.35);
}
.card-quality .q-star.filled { color: #fbbf24; }

/* --- Vignettes (default, rich cards) --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* --- Miniatures: smaller cards, image + short title only.
   All logos are shown contained so the full shape is always visible —
   miniature thumbs are too small for a cropped view to be informative. --- */
.gallery-grid.view-miniatures {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.gallery-grid.view-miniatures .card-cats,
.gallery-grid.view-miniatures .card-tags {
    display: none;
}
.gallery-grid.view-miniatures .card-body { padding: 8px 10px 10px; }
.gallery-grid.view-miniatures .card-title {
    font-size: 12px; margin: 0; max-height: 36px; line-height: 1.25;
}
.gallery-grid.view-miniatures .card-hero {
    aspect-ratio: 4 / 3;
    /* Light grey pad so contained logos have room to breathe */
    background: #f5f5f5;
}
.gallery-grid.view-miniatures .card-hero-img {
    /* Force contain in miniatures regardless of the user's bgMode — a
       cropped 4:3 thumbnail is too small to show meaningful detail of an
       edge-cropped cover. Contain gives the logo's full silhouette. */
    object-fit: contain !important;
    transform: none !important;
    padding: 8%;
    box-sizing: border-box;
}

/* --- List: stacked horizontal rows, dense --- */
.gallery-grid.view-list {
    display: flex; flex-direction: column;
    gap: 4px;
}
.gallery-grid.view-list .card {
    display: grid;
    /* 28px checkbox | 72px thumb | 1fr title+subtitle | auto cats/tags */
    grid-template-columns: 28px 72px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}
.gallery-grid.view-list .card-select {
    top: 50%; left: 8px; transform: translateY(-50%);
}
.gallery-grid.view-list .card-delete {
    top: 50%; right: 8px; transform: translateY(-50%);
    opacity: 1;
}
.gallery-grid.view-list .card-hero {
    aspect-ratio: 16 / 9;
    width: 72px; height: auto;
    border-radius: 3px; margin: 0;
    grid-column: 2;
    background: #f5f5f5;
}
.gallery-grid.view-list .card-hero-img {
    /* Same reasoning as miniatures: tiny thumbs work better as contained */
    object-fit: contain !important;
    transform: none !important;
    padding: 4%;
    box-sizing: border-box;
}
.gallery-grid.view-list .card-body {
    padding: 0 36px 0 0; display: flex; align-items: center; gap: 12px;
    min-width: 0;
    grid-column: 3 / span 2;
}
.gallery-grid.view-list .card-title {
    /* 14px semi-bold for the name… */
    font-size: 14px; font-weight: 600; margin: 0;
    max-height: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 0 1 auto; min-width: 0;
}
/* …and the subtitle appears right after, same size but regular weight,
   separated by an em-dash (inserted via CSS so the markup stays clean). */
.gallery-grid.view-list .card-subtitle {
    font-size: 14px; font-weight: 400; color: #666;
    margin: 0; line-height: 1.3; max-height: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1 1 auto; min-width: 0;
}
.gallery-grid.view-list .card-subtitle::before {
    content: ""; margin-right: 8px; color: #ccc;
}
.gallery-grid.view-list .card-description { display: none; }
/* Unify tag + category typography in list view */
.gallery-grid.view-list .card-cats,
.gallery-grid.view-list .card-tags {
    margin: 0; white-space: nowrap; font-size: 12px;
    flex: 0 0 auto;
}
.gallery-grid.view-list .card-cats span {
    font-size: 12px; padding: 2px 6px;
    background: #f3f3f3; border-radius: 3px; color: #555;
}
.gallery-grid.view-list .card-tags { max-width: 260px; overflow: hidden; text-overflow: ellipsis; color: #888; }
.gallery-grid.view-list .card-tags span { margin-right: 6px; font-size: 12px; }

/* --- Card base styles (unchanged for vignettes mode) --- */

.card {
    background: white; border-radius: 8px; overflow: hidden;
    border: 1px solid #e5e5e5;
    transition: border 120ms;
    position: relative;
}
.card.selected { border: 2px solid #111; }
.card-select {
    position: absolute; top: 10px; left: 10px; z-index: 2;
    width: 24px; height: 24px; border-radius: 4px;
    background: rgba(255,255,255,0.92);
    border: 1px solid #d0d0d0;
    color: transparent; padding: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.card.selected .card-select {
    background: #111; color: white; border: none;
}
.card-hero {
    display: block;
    aspect-ratio: 16 / 9;
    background: #f3f3f3;
    color: #bbb; font-size: 12px;
    position: relative; overflow: hidden;
    /* Create a stacking context so mix-blend-mode on the inner span only
       blends against this card's own background, not anything behind on
       the page (selection outlines, the gallery grid, etc.). */
    isolation: isolate;
}
/* Inner image layer — real <img> element. Renders at native resolution and
   plays well with html2canvas. object-fit + object-position are set inline. */
.card-hero-img {
    position: absolute; inset: 0;
    display: block;
}
.card-hero-empty {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #bbb; font-size: 12px;
}
.card-body { padding: 12px; }
.card-title {
    display: block;
    font-size: 14px; line-height: 1.3;
    margin-bottom: 8px;
    max-height: 54px; overflow: hidden;
    color: #111;
}
/* Editor stores the title as HTML (so <strong> works), but pasted content can
   carry inline font-size / font-family / line-height that leak through. Force
   inherit so every fiche's title uses the same gallery styling. <strong>
   (bold) and <em> remain intact. */
.card-title *,
.card-title strong,
.card-title span,
.card-title h1, .card-title h2, .card-title h3, .card-title p {
    font-size: inherit !important;
    font-family: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
    color: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline !important;
}
.card-title:hover { text-decoration: underline; }
.card-subtitle {
    font-size: 12px; line-height: 1.3; color: #666;
    margin-top: -4px; margin-bottom: 6px;
    max-height: 32px; overflow: hidden;
}
.card-subtitle *,
.card-subtitle span, .card-subtitle strong, .card-subtitle p {
    font-size: inherit !important;
    font-family: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
    color: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline !important;
}
.card-description {
    font-size: 11px; line-height: 1.45; color: #888;
    margin-bottom: 8px;
    max-height: 48px; overflow: hidden;
}
.card-description *,
.card-description span, .card-description strong, .card-description p {
    font-size: inherit !important;
    font-family: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline !important;
}
.card-cats { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.card-cats span {
    font-size: 10px; padding: 2px 6px;
    background: #f3f3f3; border-radius: 3px; color: #555;
}
.card-tags { font-size: 11px; color: #888; }
.card-tags span { margin-right: 6px; }

/* Delete button — overlay on top-right, mirrors the card-select position */
.card-delete {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    width: 24px; height: 24px; border-radius: 4px;
    background: rgba(255,255,255,0.92);
    border: 1px solid #d0d0d0;
    color: #c33; padding: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    opacity: 0; transition: opacity 120ms;
}
.card:hover .card-delete { opacity: 1; }
.card-delete:hover { background: #c33; color: white; border-color: #c33; }

.empty-state {
    text-align: center; padding: 80px 20px;
    color: #888; font-size: 14px;
    border: 2px dashed #e5e5e5; border-radius: 8px;
    background: white;
}

/* ---- Admin ---- */
.admin-wrap { max-width: 1000px; margin: 0 auto; padding: 24px; }
.admin-tabs { margin-bottom: 16px; display: flex; gap: 8px; }
.admin-tab {
    padding: 6px 12px; font-size: 13px;
    border-radius: 6px;
    color: #555; border: 1px solid #e5e5e5;
    background: white;
}
.admin-tab.active { background: #111; color: white; border-color: #111; }
.admin-card {
    background: white; border-radius: 8px;
    border: 1px solid #e5e5e5; overflow: hidden;
}
.admin-row {
    display: grid; gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f3f3f3;
    align-items: center;
    font-size: 13px;
}
.admin-row.header {
    background: white; border-bottom: 1px solid #e5e5e5;
    font-size: 11px; color: #999;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.admin-row.add-row { background: #fafafa; }
.admin-input {
    border: 1px solid #e5e5e5; border-radius: 4px;
    padding: 6px 8px; font-size: 13px;
    outline: none; background: white; width: 100%;
}
.icon-btn {
    border: 1px solid #e5e5e5; background: white;
    padding: 6px; border-radius: 4px; color: #555;
}
.icon-btn:hover { background: #f9f9f9; }
.icon-btn.danger { color: #c33; }
h1.page-title { font-size: 22px; font-weight: 700; margin: 8px 0 24px; }

/* ---- Editor (canvas + chrome) ---- */
.editor-app {
    display: flex; flex-direction: column; height: 100vh;
    background: #fafafa; color: #111;
}
.editor-topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid #e5e5e5; background: white;
    flex-shrink: 0;
}
.editor-preset-picker {
    display: flex; gap: 2px;
    background: #f3f3f3; border-radius: 8px; padding: 2px;
}
.editor-preset-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px; font-size: 12px;
    background: transparent; color: #666;
    border: none; border-radius: 6px; cursor: pointer;
}
.editor-preset-btn.active {
    background: white; color: #111; font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
/* editor-main was previously a row [canvas | sidebar]. The sidebar content
   has been moved into the metabar above, so the main is just the canvas now. */
.editor-main { flex: 1; display: flex; overflow: hidden; }
.editor-canvas-wrap {
    flex: 1; overflow: auto;
    display: flex; align-items: center; justify-content: center;
    padding: 48px;
    background: #f0f0f0;
    background-image: radial-gradient(circle at 1px 1px, #d8d8d8 1px, transparent 0);
    background-size: 16px 16px;
    position: relative;
}
.editor-canvas-frame {
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
}

/* ========== Editor meta bar (horizontal, above canvas) ========== */
.editor-metabar {
    display: flex; flex-direction: row; align-items: flex-start;
    gap: 18px; padding: 10px 20px;
    background: #fafafa;
    border-bottom: 1px solid #e5e5e5;
    flex-wrap: wrap;
    font-size: 12px;
}
.metabar-section {
    display: flex; flex-direction: column; gap: 6px;
    min-width: 0;
}
.metabar-section-label {
    font-size: 9px; color: #999;
    text-transform: uppercase; letter-spacing: 0.06em;
    font-weight: 600;
}

/* Paste zone (narrow, inline) */
.metabar-paste { flex: 0 0 auto; align-self: stretch; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.paste-box-inline {
    width: 180px; height: 40px;
    border: 1.5px dashed #c0c0c0;
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 11px; outline: none; resize: none;
    font-family: inherit;
    background: white; color: #888;
    transition: border-color 120ms, background 120ms, color 120ms;
}
.paste-box-inline:hover { border-color: #888; color: #444; }
.paste-box-inline.active,
.paste-box-inline:focus {
    border-color: #111; border-style: solid; background: #fafafa; color: #111;
}
.metabar-add-text {
    width: 180px; height: 22px;
    border: 1px solid #e5e5e5; background: white;
    border-radius: 4px; font-size: 11px; color: #555;
    cursor: pointer; font-family: inherit;
    padding: 0; transition: background 100ms, color 100ms;
}
.metabar-add-text:hover { background: #111; color: white; border-color: #111; }

/* Tags section (takes the most room) */
.metabar-tags { flex: 1 1 360px; min-width: 280px; }

/* URL section — compact single row with inline "URL" label */
.metabar-url { flex: 1 1 300px; min-width: 260px; }
.metabar-url-row {
    display: flex; gap: 6px; align-items: center; flex-wrap: nowrap;
}
.metabar-inline-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
    color: #999; font-weight: 500;
    flex: 0 0 auto;
}
.metabar-url-input {
    flex: 1 1 auto; min-width: 120px;
    border: 1px solid #d5d5d5; background: white;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px; font-family: inherit;
    outline: none; color: #111;
    height: 26px;
}
.metabar-url-input:focus { border-color: #111; }

/* Standalone quality row (label + 3-star selector + clear).
   Its own section so users don't read it as "rate the URL". */
.metabar-quality-row {
    display: flex; align-items: center; gap: 10px;
}
.metabar-quality {
    display: inline-flex; align-items: center; gap: 1px;
    padding: 0 6px;
    height: 26px;
    background: white;
    border: 1px solid #d5d5d5;
    border-radius: 4px;
}
.metabar-q-star {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px;
    background: none; border: none; padding: 0;
    font-size: 16px; line-height: 1;
    color: #ddd;
    cursor: pointer;
    font-family: inherit;
    transition: color 100ms, transform 100ms;
}
.metabar-q-star:hover { color: #999; transform: scale(1.15); }
.metabar-q-star.on { color: #fbbf24; }
.metabar-q-star.on:hover { color: #f59e0b; }
.metabar-q-star.active { color: #f59e0b; }
.metabar-quality-clear {
    background: none; border: none;
    font-family: inherit; font-size: 11px;
    color: #999; cursor: pointer;
    padding: 0; text-decoration: underline;
}
.metabar-quality-clear:hover { color: #111; }


.suggest-tags-wrap {
    position: relative;
    display: flex; align-items: center;
    flex: 0 0 auto;
}
.suggest-tags-btn {
    background: #111; color: white; border: none;
    border-radius: 4px; padding: 4px 10px;
    font-size: 12px; font-family: inherit; font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    height: 26px;
}
.suggest-tags-btn:hover { background: #333; }
.suggest-tags-btn:disabled { background: #aaa; cursor: wait; }

/* --- Description IA (hover-triggered chip on the description field) --- */
/* The slot wraps the TextBlock so the button can be positioned absolute
   relative to the description area. */
.description-slot {
    position: relative;
}
.desc-ai-btn {
    position: absolute;
    top: 8px; right: 0;
    background: #111; color: white; border: none;
    border-radius: 4px; padding: 3px 9px;
    font-size: 11px; font-family: inherit; font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 140ms, transform 140ms;
    pointer-events: none;  /* only clickable when visible */
    z-index: 5;
}
.description-slot:hover .desc-ai-btn,
.desc-ai-btn:focus-visible,
.desc-ai-btn.loading {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.desc-ai-btn:hover { background: #333; }
.desc-ai-btn:disabled { background: #aaa; cursor: not-allowed; }
.desc-ai-btn.loading { background: #444; cursor: wait; }

.desc-ai-err {
    position: absolute;
    top: 34px; right: 0;
    font-size: 11px; color: #b91c1c;
    max-width: 260px; line-height: 1.35;
    background: white; padding: 5px 22px 5px 9px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    z-index: 6;
}
.desc-ai-err-close {
    position: absolute; top: 2px; right: 4px;
    background: none; border: none; padding: 0;
    color: #999; font-size: 13px; line-height: 1; cursor: pointer;
}
.desc-ai-err-close:hover { color: #111; }

/* Suggested chips: pop out under the button as an absolute layer so they
   don't push the layout. Fall back to inline if the panel is very narrow. */
.suggest-tags-err {
    position: absolute; top: calc(100% + 4px); left: 0;
    font-size: 11px; color: #b91c1c; max-width: 220px;
    line-height: 1.3; z-index: 20;
    background: white; padding: 4px 8px; border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.suggest-tags-chips {
    position: absolute; top: calc(100% + 4px); right: 0;
    display: flex; flex-wrap: wrap; gap: 4px;
    max-width: 460px; z-index: 20;
    background: white; padding: 8px 8px 10px; border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}
.suggest-tags-chips::before {
    content: "Suggestions IA \2014 cliquer pour ajouter";
    display: block; width: 100%;
    font-size: 10px; color: #888; text-transform: uppercase;
    letter-spacing: .05em; margin-bottom: 4px;
}
.suggest-tag-chip {
    display: inline-flex; align-items: center;
    font-size: 11px; color: #111;
    background: #f0f7ff;
    border: 1px solid #b8dcff;
    border-radius: 999px;
    padding: 3px 9px;
    cursor: pointer;
    font-family: inherit;
}
.suggest-tag-chip:hover { background: #dbeafe; border-color: #60a5fa; }
.suggest-tag-chip.existing {
    background: #f0fdf4; border-color: #86efac; color: #166534;
}
.suggest-tag-chip.existing:hover { background: #dcfce7; border-color: #22c55e; }
.suggest-tag-chip.in {
    background: #f3f3f3; border-color: #e0e0e0; color: #888;
    cursor: default; text-decoration: line-through;
}

/* Category suggestions block — always shown first with its own label
   and a distinct purple pill so users know it's a controlled-vocabulary
   category, not a free-form tag. */
.suggest-cats-row {
    display: flex; flex-wrap: wrap; gap: 4px;
    width: 100%;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px dashed #eee;
    position: relative;
}
.suggest-cats-row::before {
    content: "Catégories";
    display: block; width: 100%;
    font-size: 9px; color: #7c3aed; text-transform: uppercase;
    letter-spacing: .06em; font-weight: 600;
    margin-bottom: 3px;
}
.suggest-cat-chip {
    display: inline-flex; align-items: center;
    font-size: 11px; color: #5b21b6;
    background: #f5f3ff;
    border: 1px solid #c4b5fd;
    border-radius: 999px;
    padding: 3px 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
}
.suggest-cat-chip:hover {
    background: #ede9fe;
    border-color: #8b5cf6;
    color: #4c1d95;
}
/* Small close-x button in the suggestion popover */
.suggest-tags-close {
    position: absolute; top: 4px; right: 4px;
    background: none; border: none; cursor: pointer;
    font-size: 14px; color: #999; padding: 0;
    width: 18px; height: 18px; line-height: 1;
}
.suggest-tags-close:hover { color: #111; }

.metabar-tags-row {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.metabar-tag-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; color: #111;
    background: #ececec;
    border-radius: 999px;
    padding: 3px 4px 3px 10px;
    line-height: 1.3;
}
.metabar-tag-x {
    border: none; background: none; cursor: pointer;
    width: 16px; height: 16px; border-radius: 999px;
    color: #888; font-size: 14px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0;
}
.metabar-tag-x:hover { background: #ddd; color: #111; }
.metabar-tag-input-wrap { position: relative; display: inline-block; }
.metabar-tag-input {
    border: 1px dashed #c7c7c7; background: transparent;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px; font-family: inherit;
    outline: none; width: 110px;
    color: #111;
}
.metabar-tag-input:focus {
    border-style: solid; border-color: #111; background: white;
}
.metabar-tag-ac {
    position: absolute; top: calc(100% + 4px); left: 0; z-index: 50;
    background: white; border: 1px solid #e5e5e5; border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 4px; min-width: 160px;
    max-height: 240px; overflow-y: auto;
}
.metabar-tag-ac-item {
    display: block; width: 100%; text-align: left;
    border: none; background: transparent;
    padding: 6px 10px; border-radius: 3px;
    cursor: pointer; font-size: 12px; color: #111;
}
.metabar-tag-ac-item:hover { background: #f3f3f3; }

/* Top-20 chips (suggestions) */
.metabar-tags-top {
    display: flex; flex-wrap: nowrap; gap: 4px;
    margin-top: 4px;
    overflow-x: auto;
    padding-bottom: 4px;
    /* Thin, unobtrusive scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #d0d0d0 transparent;
    -webkit-mask-image: linear-gradient(to right, black 90%, transparent);
            mask-image: linear-gradient(to right, black 90%, transparent);
}
.metabar-tags-top::-webkit-scrollbar { height: 4px; }
.metabar-tags-top::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 2px; }
.metabar-tags-top .metabar-tag-chip { flex: 0 0 auto; }
.metabar-tag-chip {
    border: 1px solid #e5e5e5; background: white;
    border-radius: 999px;
    padding: 2px 8px; font-size: 10.5px;
    color: #666; cursor: pointer;
    transition: background 100ms, color 100ms, border-color 100ms;
}
.metabar-tag-chip:hover {
    background: #111; color: white; border-color: #111;
}

/* Popovers (categories / expertises) */
.metabar-popover-wrap { position: relative; flex: 0 0 auto; }
.metabar-popover-btn {
    display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid #e5e5e5; background: white;
    border-radius: 5px; padding: 6px 10px;
    font-size: 12px; color: #111; cursor: pointer;
    font-family: inherit;
}
.metabar-popover-btn:hover { background: #fafafa; }
.metabar-popover-btn.open {
    background: #111; color: white; border-color: #111;
}
.metabar-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; border-radius: 999px;
    background: #111; color: white; font-size: 10px; font-weight: 600;
    padding: 0 5px; margin-left: 4px;
}
.metabar-popover-btn.open .metabar-badge { background: white; color: #111; }
.metabar-popover {
    position: absolute; top: calc(100% + 4px); left: 0; z-index: 100;
    background: white; border: 1px solid #e5e5e5; border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 8px; min-width: 260px;
}
.metabar-popover-list {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.metabar-pill {
    border: 1px solid #e5e5e5; background: white;
    border-radius: 999px;
    padding: 4px 10px; font-size: 11px;
    color: #111; cursor: pointer; font-family: inherit;
}
.metabar-pill:hover { background: #fafafa; }
.metabar-pill.selected {
    background: #111; color: white; border-color: #111;
}

/* Infos block (auteur / modifié) */
.metabar-infos {
    flex: 0 0 auto; flex-direction: row; gap: 12px;
    color: #666; font-size: 11px; align-items: center;
    margin-left: auto;
}
.metabar-infos strong { color: #444; font-weight: 600; }

/* Legacy sidebar class kept for safety; no longer rendered but some user
   styles might reference it. Set to display:none to avoid visual clutter
   in case of a stale script cache. */
.editor-sidebar { display: none; }

.editor-section-label {
    font-size: 10px; color: #999;
    text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.editor-section { margin-bottom: 20px; }
.paste-box {
    width: 100%; height: 64px;
    border: 2px dashed #d0d0d0;
    border-radius: 6px; padding: 8px;
    font-size: 11px; outline: none; resize: none;
    font-family: inherit;
    background: #fafafa; color: #666;
}
.cat-pill {
    padding: 3px 8px; font-size: 11px;
    border-radius: 999px;
    background: #f3f3f3; color: #555;
    border: none; cursor: pointer;
    margin: 0 4px 4px 0;
}
.cat-pill.selected { background: #111; color: white; }
.save-state {
    font-size: 12px; color: #888;
    padding: 3px 8px; border-radius: 4px;
    transition: background 150ms, color 150ms;
}
.save-state.error {
    color: #b91c1c; background: #fef2f2;
    border: 1px solid #fecaca;
    font-weight: 500;
}

/* ---- The 1360x816 printable page ---- */
.page {
    width: 1360px; height: 816px; background: white;
    position: relative; transform-origin: top left; flex-shrink: 0;
}
.slot {
    position: relative; overflow: hidden; background: #ececec;
    transition: background 120ms ease;
    outline: 2px solid transparent; outline-offset: -2px;
}
.slot:hover { background: #e3e3e3; }
.slot:hover .slot-overlay { opacity: 1; }
.slot-dragover {
    outline: 2px solid #2563eb !important;
    outline-offset: 2px !important;
    background: #dbeafe !important;
}
/* Hide editor chrome (add-image button, tag controls, etc.) during PDF capture */
.bm-rendering-pdf .bm-editor-chrome {
    display: none !important;
}
.bm-rendering-pdf .bm-placeholder {
    display: none !important;
}

/* Libre grid handles — visible on hover, always visible while dragging */
/* --- Figma-style image overlay ------------------------------------------
   Idle: nothing visible. On hover, a bordered frame + 8 resize handles +
   a centered ⊕ crop pill + a discreet toolbar (+/-, mode) appear. Clicking
   anywhere inside the image (not on a handle/pill) drags the whole tile
   across the page. Overlap is allowed but painted red as a warning. */

.bm-libre-slot-wrap { cursor: default; }
.bm-libre-slot-wrap:hover { cursor: grab; }
.bm-libre-slot-wrap:active { cursor: grabbing; }

/* The outline appears on hover. Inset -1 so it hugs the image without
   changing the tile's geometry. */
.bm-libre-slot-wrap::before {
    content: "";
    position: absolute; inset: -1px;
    border: 1px solid rgba(24, 24, 27, 0.55);
    border-radius: 2px;
    pointer-events: none;
    opacity: 0; transition: opacity 120ms;
    z-index: 4;
}
.bm-libre-slot-wrap:hover::before { opacity: 1; }
/* While dragging with a collision, turn the outline red as a warning. */
.bm-libre-slot-wrap.bm-collide::before {
    border-color: #e11d48; border-width: 2px; opacity: 1;
}

/* 8 resize handles: 4 corners + 4 edge midpoints. Small white squares with
   a thin border, only visible on hover. */
.bm-resize-h {
    position: absolute;
    width: 10px; height: 10px;
    background: #fff;
    border: 1px solid rgba(24, 24, 27, 0.65);
    border-radius: 1px;
    opacity: 0; transition: opacity 120ms;
    z-index: 6;
    pointer-events: auto;
}
.bm-libre-slot-wrap:hover .bm-resize-h { opacity: 1; }
.bm-resize-h.nw { top: -5px;    left: -5px;    cursor: nwse-resize; }
.bm-resize-h.n  { top: -5px;    left: calc(50% - 5px); cursor: ns-resize; }
.bm-resize-h.ne { top: -5px;    right: -5px;   cursor: nesw-resize; }
.bm-resize-h.e  { top: calc(50% - 5px); right: -5px;   cursor: ew-resize; }
.bm-resize-h.se { bottom: -5px; right: -5px;   cursor: nwse-resize; }
.bm-resize-h.s  { bottom: -5px; left: calc(50% - 5px); cursor: ns-resize; }
.bm-resize-h.sw { bottom: -5px; left: -5px;    cursor: nesw-resize; }
.bm-resize-h.w  { top: calc(50% - 5px); left: -5px;    cursor: ew-resize; }

/* Centered crop pill: dark round button with the ⊕ move icon. Clicking it
   opens the crop modal to reframe the image inside its container. */
.bm-crop-pill {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 36px; height: 36px;
    background: rgba(24, 24, 27, 0.75);
    color: #fff;
    border: none; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    cursor: move;
    opacity: 0; transition: opacity 120ms, background 120ms;
    z-index: 7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.bm-crop-pill:active { cursor: grabbing; }
.bm-libre-slot-wrap:hover .bm-crop-pill { opacity: 1; }
.bm-crop-pill:hover { background: rgba(24, 24, 27, 0.9); }

/* Discreet toolbar top-left: zoom-, zoom+, and mode toggle. Only visible
   on hover, small and unobtrusive. */
.bm-tile-toolbar {
    position: absolute;
    top: 4px; left: 4px;
    display: flex; gap: 2px;
    background: rgba(24, 24, 27, 0.75);
    border-radius: 3px;
    padding: 2px;
    opacity: 0; transition: opacity 120ms;
    z-index: 7;
}
.bm-libre-slot-wrap:hover .bm-tile-toolbar { opacity: 1; }
.bm-tile-toolbar button {
    background: transparent; border: none;
    color: #fff;
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; line-height: 1;
    cursor: pointer;
    border-radius: 2px;
    padding: 0;
}
.bm-tile-toolbar button:hover { background: rgba(255, 255, 255, 0.18); }

/* Top-right controls (star for promote-to-logo, × for delete) — kept but
   smaller and aligned to match the new toolbar aesthetic. */
.bm-tile-controls-right {
    position: absolute;
    top: 4px; right: 4px;
    display: flex; gap: 2px;
    background: rgba(24, 24, 27, 0.75);
    border-radius: 3px;
    padding: 2px;
    opacity: 0; transition: opacity 120ms;
    z-index: 7;
}
.bm-libre-slot-wrap:hover .bm-tile-controls-right { opacity: 1; }
.bm-tile-controls-right button {
    background: transparent; border: none;
    color: #fff;
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; line-height: 1;
    cursor: pointer;
    border-radius: 2px;
    padding: 0;
}
.bm-tile-controls-right button:hover { background: rgba(255, 255, 255, 0.18); }
.bm-tile-controls-right button.danger:hover { background: #dc2626; }

/* Legacy handle classes retained but hidden — they still get rendered in
   places we haven't refactored yet (palette, logo when in special modes). */
.bm-libre-move-handle,
.bm-libre-resize-handle,
.bm-libre-crop-handle,
.bm-libre-logo-handle,
.bm-slot-delete {
    display: none;
}

.slot-empty { border: 1px dashed #c7c7c7; background: #f4f4f4; }
.slot-empty-hidden {
    background: transparent;
    border: none;
    transition: background 120ms ease;
}
.slot-empty-hidden:hover { background: rgba(0,0,0,0.03); }

/* Text tile color pickers — visible only on hover */
.bm-texttile-controls {
    position: absolute; bottom: 6px; left: 6px;
    display: flex; gap: 8px;
    background: rgba(255,255,255,0.92);
    padding: 4px 6px; border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    opacity: 0; transition: opacity 120ms;
    pointer-events: none;
}
.slot:hover .bm-texttile-controls,
.bm-libre-slot-wrap:hover .bm-texttile-controls {
    opacity: 1;
    pointer-events: auto;
}

/* Flash a freshly-added image coming from the Chrome extension */
@keyframes slot-flash {
    0%   { box-shadow: inset 0 0 0 3px #059669, 0 0 0 4px rgba(5, 150, 105, 0.35); transform: scale(1); }
    40%  { box-shadow: inset 0 0 0 3px #059669, 0 0 0 12px rgba(5, 150, 105, 0); transform: scale(1.015); }
    100% { box-shadow: inset 0 0 0 0 rgba(5, 150, 105, 0), 0 0 0 0 rgba(5, 150, 105, 0); transform: scale(1); }
}
.slot-flash {
    animation: slot-flash 1.6s ease-out;
    z-index: 10;
}
.slot-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.35); color: white;
    opacity: 0; transition: opacity 120ms ease; gap: 8px;
}
.slot-overlay button {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 6px 10px; border-radius: 999px;
    font-size: 11px; cursor: pointer;
}
.slot-overlay button:hover { background: rgba(255,255,255,0.25); }

.palette-swatch:hover .palette-remove { display: flex !important; }

/* + bouton d'ajout de couleur : invisible sauf au survol du bloc palette */
.palette-add { opacity: 0; transition: opacity 150ms; }
/* Hovering the palette strip or the add button itself keeps it visible,
   so the click target doesn't disappear while the cursor is approaching. */
.palette-strip:hover .palette-add,
.palette-add:hover,
.palette-add:focus-visible { opacity: 1; }
.palette-add:hover { background: #fafafa; border-color: #888; color: #222; }

.tag-pill {
    display: inline-flex; align-items: center;
    background: #e9e9e9; border-radius: 999px;
    padding: 4px 12px; font-size: 13px; color: #111;
    margin-bottom: 6px; white-space: nowrap;
}
.inline-input {
    border: none; background: transparent;
    outline: none; padding: 0; font: inherit; color: inherit;
}
.inline-input:focus { background: #fff9c4; }
