/* 💡 Пропозиції — дошка ідей співробітників (js/ideas.js, власник 25.11.2026). Apple-стиль за CLAUDE.md: поверхні .card / .card.tap,
   сегменти .seg / .seg-btn.on, статуси .chip ok|warn|info|bad|mut, .pill, .reveal / .open, .hero-num — глобальний шар css/apple-ui.css;
   коментарі — .prj-cmt (css/projects.css), подіум і список рейтингу — .lb-* (css/cabinet.css), обидва підключені глобально.
   Тут — ЛИШЕ розкладка з префіксом ida- і мобільні правила розділу (≤ 768 px); css/mobile-ux.css не чіпаємо.
   ⚠ Класи .filters-bar / .filter-bar / [data-m-filters] НЕ використовуємо: їх згортає двигун js/mobile.js — фільтри на телефоні
   ховаємо самі (⚙ → .reveal, Δ10). ⚠ .btn має display: inline-flex — атрибут hidden без правила нижче не ховав би кнопку. */

.ida [hidden], .ida-m [hidden] { display: none !important; }
.ida { display: flex; flex-direction: column; gap: 12px; min-width: 0; max-width: 1280px; }
.ida-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ida-msg { padding: 16px; font-size: 13.5px; color: var(--text-secondary, #555); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── панель фільтрів: десктоп — один потік із переносом; пошук і «➕» — у кінці ── */
.ida-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px; }
.ida-bar-search, .ida-more, .ida-more > div, .ida-more-in { display: contents; }
.ida-more.reveal { opacity: 1; transform: none; }
.ida-q { order: 5; flex: 1 1 200px; width: auto; min-width: 0; max-width: 340px; }
.ida-filters-btn { display: none; }
.ida-new { order: 6; margin-left: auto; }
.ida-author { order: 7; flex: 1 1 100%; }
.ida-n { font-weight: 500; opacity: .62; margin-left: 4px; font-variant-numeric: tabular-nums; }
.ida-x { appearance: none; border: 0; background: none; padding: 0 0 0 2px; font: inherit; color: inherit; cursor: pointer; }

/* ── сітка карток ── */
.ida-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.ida-card { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ida-card:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }
.ida-card-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ida-no { margin-left: auto; font-size: 12px; color: var(--text-muted, #888); font-variant-numeric: tabular-nums; }
.ida-title { font-size: 15px; font-weight: 700; line-height: 1.3; letter-spacing: -0.005em; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ida-ex { font-size: 13px; line-height: 1.45; color: var(--text-secondary, #555); overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ida-thumbs { display: flex; gap: 6px; }
.ida-thumbs img, .ida-thumb-more { width: 64px; height: 64px; border-radius: 9px; flex: 0 0 auto; }
.ida-thumbs img { object-fit: cover; display: block; background: var(--bg-tertiary, #eef1f6); }
.ida-thumb-more { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
    background: color-mix(in srgb, var(--text-primary, #000) 7%, transparent); color: var(--text-secondary, #555); }
.ida-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 2px; font-size: 12px; color: var(--text-muted, #888); min-width: 0; }
.ida-who { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.ida-who-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ida-who-l { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ida-who-name { font-weight: 600; color: var(--text-primary, #222); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ida-time { white-space: nowrap; font-size: 11.5px; }
.ida-cnt { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ida-vote { white-space: nowrap; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.ida-vote:disabled { opacity: .55; cursor: default; }
.ida-vote:disabled:active { transform: none; }
.ida-list.is-loading { opacity: .55; transition: opacity 120ms ease; }
.ida-more-wrap { display: flex; justify-content: center; }
.ida-more-wrap:empty { display: none; }
.ida-empty { padding: 28px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ida-empty p { margin: 0; max-width: 520px; font-size: 14px; line-height: 1.5; color: var(--text-secondary, #555); }
.ida-empty-ico { font-size: 40px; line-height: 1; }

/* ── модалки: деталь і форма (#modalBody) ── */
.ida-m { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ida-d-h { display: flex; align-items: flex-start; gap: 8px; }
.ida-d-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.ida-d-tools { display: flex; gap: 6px; flex: 0 0 auto; }
.ida-ib { width: 30px; height: 30px; min-width: 30px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; }
.ida-d-meta { font-size: 12.5px; color: var(--text-muted, #888); line-height: 1.45; }
.ida-d-meta b { color: var(--text-secondary, #555); font-weight: 600; }
.ida-d-title { font-size: 19px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; overflow-wrap: anywhere; margin: 0; }
.ida-d-body { font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ida-d-body a, .ida-cmt a, .ida-answer a { color: var(--accent, #2563eb); overflow-wrap: anywhere; }
.ida-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.ida-gal.sm { grid-template-columns: repeat(auto-fill, 72px); margin-top: 8px; }
.ida-ph { position: relative; appearance: none; border: 0; padding: 0; margin: 0; background: var(--bg-tertiary, #eef1f6); border-radius: 10px;
    overflow: hidden; aspect-ratio: 1; cursor: zoom-in; display: block; width: 100%; }
.ida-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ida-ph:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }
.ida-ph-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; background: rgba(0, 0, 0, .55); }
.ida-reason, .ida-answer { padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.ida-reason { background: color-mix(in srgb, #dc2626 9%, transparent); }
.ida-answer { background: color-mix(in srgb, var(--accent, #2563eb) 10%, transparent); color: var(--text-primary, #222); }
.ida-reason-h, .ida-answer-h { font-size: 12px; color: var(--text-secondary, #555); margin-bottom: 4px; }
.ida-reason-t, .ida-answer-t { white-space: pre-wrap; }
.ida-d-vote { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted, #888); }
.ida-mod { padding: 12px; display: flex; flex-direction: column; }   /* без gap: закриті .reveal не додають порожнечі */
.ida-mod-h { margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted, #888); }
.ida-mod-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ida-mod-row .ida-ib { width: 38px; height: 38px; min-width: 38px; }
.ida-hint { font-size: 12.5px; color: var(--text-muted, #888); line-height: 1.45; }
.ida-rev-in { display: flex; flex-direction: column; gap: 6px; padding: 12px 3px 3px; }
.ida-row-end { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.ida-count { font-size: 11.5px; color: var(--text-muted, #888); font-variant-numeric: tabular-nums; margin-right: auto; }
/* закритий .reveal не ловить Tab (видимість гаситься після анімації згортання) */
.ida-m .reveal > div { transition: visibility 0s linear 320ms; }
.ida-m .reveal:not(.open) > div { visibility: hidden; }
.ida-m .reveal.open > div { visibility: visible; transition-delay: 0s; }
.ida-sec-h { font-size: 13px; font-weight: 700; margin-top: 4px; }
.ida-feed { display: flex; flex-direction: column; }
.ida-cmt .prj-cmt__h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ida-cmt .prj-cmt__h .n { margin-left: 0; }
.ida-cmt-act { margin-left: auto; display: inline-flex; gap: 4px; }
.ida-cmt.is-del .prj-cmt__b { color: var(--text-muted, #888); font-style: italic; }
.ida-act { font-size: 12.5px; color: var(--text-muted, #888); padding: 4px 2px 10px; line-height: 1.45; overflow-wrap: anywhere; }
.ida-act b { color: var(--text-secondary, #555); font-weight: 600; }
.ida-empty-feed { font-size: 13px; color: var(--text-muted, #888); padding: 6px 2px 10px; }
.ida-cbox { display: flex; flex-direction: column; gap: 8px; }
.ida-cbox textarea { resize: vertical; min-height: 72px; }
.ida-cbox-row { display: flex; align-items: center; gap: 8px; }
.ida-cedit { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.ida-prog { height: 6px; border-radius: 4px; background: var(--border, #e5e7eb); overflow: hidden; }
.ida-prog > i { display: block; height: 100%; width: 0; background: var(--accent, #2563eb); transition: width 150ms linear; }
.ida-prev { display: flex; gap: 10px; flex-wrap: wrap; }
.ida-prev:empty { display: none; }
.ida-prev-it { position: relative; width: 72px; height: 72px; flex: 0 0 auto; }
.ida-prev-it img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; display: block; background: var(--bg-tertiary, #eef1f6); }
.ida-prev-x { position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
    border: 2px solid var(--bg-secondary, #fff); background: var(--text-primary, #222); color: var(--bg-secondary, #fff);
    display: inline-flex; align-items: center; justify-content: center; font-size: 11px; line-height: 1; padding: 0; }
.ida-form { gap: 14px; }
.ida-f-row { display: flex; flex-direction: column; gap: 6px; }
.ida-f-l { font-size: 12.5px; font-weight: 600; color: var(--text-secondary, #555); }
.ida-form textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.ida-drop { appearance: none; width: 100%; padding: 14px; border-radius: 12px; cursor: pointer; font: 500 13px/1.4 inherit; text-align: center;
    color: var(--text-secondary, #555); background: transparent; border: 1.5px dashed color-mix(in srgb, var(--text-primary, #000) 22%, transparent);
    transition: background 160ms ease, border-color 160ms ease; }
.ida-drop:hover, .ida-drop.over { border-color: var(--accent, #2563eb); background: color-mix(in srgb, var(--accent, #2563eb) 7%, transparent); }
.ida-drop:disabled { opacity: .5; cursor: default; }
.ida-draft { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px;
    font-size: 13px; background: color-mix(in srgb, var(--accent, #2563eb) 10%, transparent); }
.ida-err { font-size: 13px; color: #b91c1c; }
.ida-f-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ── лайтбокс: окремий шар у body між модалкою (300) і тостами (400); матеріал — розмиття + темне тло (apple-design §12) ── */
.ida-lb { position: fixed; inset: 0; z-index: 350; display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); touch-action: none; overscroll-behavior: contain; }
.ida-lb-img { display: block; max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: 8px; user-select: none; -webkit-user-select: none;
    -webkit-user-drag: none; box-shadow: 0 18px 60px rgba(0, 0, 0, .45); background: rgba(255, 255, 255, .04); will-change: transform; cursor: grab; }
.ida-lb-btn { position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font-size: 24px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .14);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.ida-lb-btn:hover { background: rgba(255, 255, 255, .24); }
.ida-lb-btn:disabled { opacity: .3; cursor: default; }
.ida-lb-x { top: 16px; right: 16px; font-size: 18px; }
.ida-lb-prev { left: 16px; top: calc(50% - 22px); }
.ida-lb-next { right: 16px; top: calc(50% - 22px); }
.ida-lb-n { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); padding: 4px 11px; border-radius: 999px; font-size: 13px;
    color: #fff; background: rgba(0, 0, 0, .42); font-variant-numeric: tabular-nums; }

/* ── рейтинг ── */
.ida-rating { display: flex; flex-direction: column; gap: 12px; }
.ida-rating > .seg { align-self: flex-start; }
.ida-me { padding: 14px 16px; display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; }
.ida-me-l { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted, #888); }
.ida-me-sub { font-size: 13px; color: var(--text-secondary, #555); line-height: 1.5; }
.ida-rating .lb-podium { margin-bottom: 0; }
.ida-pod, .ida-lb-row { cursor: pointer; }
.ida-pod:focus-visible, .ida-lb-row:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: -2px; }
.ida-lb-row:active { background: color-mix(in srgb, var(--text-primary, #000) 4%, transparent); }
.ida-pod.is-me { box-shadow: 0 0 0 2px var(--accent, #2563eb) inset; }
.ida-pod-pts { margin-top: 6px; font-size: 12px; color: var(--text-muted, #888); }
.ida-pod-pts .hero-num { font-size: 1.5rem; color: var(--text-primary, #222); }
.ida-lb-meta { font-size: 11.5px; color: var(--text-muted, #888); margin-top: 3px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.ida-lb-pts { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ida-lb-pts small { font-size: 11px; font-weight: 600; color: var(--text-muted, #888); margin-left: 2px; }
.ida-legend { font-size: 12px; color: var(--text-muted, #888); line-height: 1.55; padding: 0 2px; }
/* Δ9: на ≤ 640 px cabinet.css кладе подіум в одну колонку, а в DOM порядок 2 · 1 · 3 — золото першим */
@media (max-width: 640px) {
    .ida-rating .lb-pod--1 { order: -1; }
}

/* ── телефон (≤ 768 px): фільтри — статуси, пошук + «⚙ Фільтри», решта — у .reveal (Δ10); тап-зони ≥ 44 px ── */
@media (max-width: 768px) {
    .ida { gap: 10px; }
    .ida .seg-btn { min-height: 44px; }
    .ida-tabs { width: 100%; }
    .ida-tabs .seg-btn { flex: 1 1 0; }
    .ida-bar { flex-direction: column; align-items: stretch; gap: 8px; padding: 8px; }
    .ida-bar-search { display: flex; align-items: center; gap: 8px; }
    .ida-q { order: 0; flex: 1 1 auto; max-width: none; min-height: 44px; }
    .ida-filters-btn { display: inline-flex; flex: 0 0 auto; min-height: 44px; padding: 0 14px !important; }
    .ida-more.reveal { display: grid; opacity: 0; transform: translateY(-4px); }
    .ida-more.reveal.open { opacity: 1; transform: translateY(0); }
    .ida-more > div { display: block; overflow: hidden; min-height: 0; transition: visibility 0s linear 320ms; }
    .ida-more:not(.open) > div { visibility: hidden; }
    .ida-more.open > div { visibility: visible; transition-delay: 0s; }
    .ida-more-in { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 2px 0; }
    .ida-more-in .seg { width: 100%; }
    .ida-more-in .seg-btn { flex: 1 1 0; }
    .ida-mine { min-height: 44px; }
    .ida-new { order: 0; width: 100%; margin-left: 0; min-height: 44px; }
    .ida-thumbs img, .ida-thumb-more { width: 56px; height: 56px; }
    .ida-vote, .ida .pill { min-height: 44px; padding-left: 14px; padding-right: 14px; }
    .ida-rating > .seg { align-self: stretch; }
    .ida-rating > .seg .seg-btn { flex: 1 1 0; }
    .ida-ib { width: 44px; height: 44px; min-width: 44px; }
    .ida-mod-row .ida-ib { width: 44px; height: 44px; min-width: 44px; }
    .ida-m .btn { min-height: 44px; }
    .ida-prev-x { width: 28px; height: 28px; }
    .ida-lb-img { max-width: 100vw; max-height: 100dvh; border-radius: 0; box-shadow: none; }
    .ida-lb-prev, .ida-lb-next { display: none; }
    .ida-lb-x { top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; }
}

/* ── доступність (apple-design §14) ── */
@media (prefers-reduced-transparency: reduce) {
    .ida-lb { background: #000; -webkit-backdrop-filter: none; backdrop-filter: none; }
    .ida-lb-btn { -webkit-backdrop-filter: none; backdrop-filter: none; background: #333; }
}
@media (prefers-contrast: more) {
    .ida-drop { border-color: currentColor; }
    .ida-lb-btn { outline: 1px solid #fff; }
}
