/* Minimal additions to the existing case detail and the inline contribution view. */
.case-detail-v1 .case-detail-shell.has-collective-owner { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.collective-owner { margin: 14px 0 18px; padding: 15px; border-radius: 16px; color: #edf9ff; }
.collective-owner[hidden] { display: none !important; }
.collective-owner h3 { margin: 0 0 10px; font-size: 17px; }
.collective-owner h4 { margin: 18px 0 8px; font-size: 15px; }
.collective-owner p { margin: 6px 0; font-size: 13px; line-height: 1.4; }
.collective-empty { color: #a6c9dc; }
.collective-review-item { margin-top: 12px; padding: 12px; border: 1px solid rgba(153,224,240,.3); border-radius: 12px; background: rgba(3,35,69,.4); }
.collective-review-item.is-accepted { border-color: rgba(105,210,184,.42); background: rgba(4,67,69,.25); }
.collective-review-item img { display: block; width: 100%; max-height: min(56vh, 420px); object-fit: contain; margin: 10px 0; border-radius: 9px; background: rgba(0, 14, 36, .45); }
.collective-review-item img[role="button"] { cursor: zoom-in; }
.collective-review-item img[role="button"]:focus-visible { outline: 2px solid #67ddef; outline-offset: 3px; }
.collective-review-item img[hidden] { display: none; }
.collective-photo-status { color: #a6e7f5; }
.collective-review-date, .collective-review-source, .collective-secondary-stats { color: #a6c9dc; }
.collective-review-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.collective-accepted-summary { margin-top: 17px !important; font-weight: 700; }
.collective-source-name { margin-top: 12px; color: #a6e7f5; font-size: 13px; }
.collective-source-name summary { cursor: pointer; width: fit-content; }
.collective-review-actions { display: flex; gap: 8px; margin-top: 10px; }
.collective-review-actions button, .collective-source-form button { min-height: 38px; padding: 7px 12px; border: 1px solid rgba(136,220,244,.5); border-radius: 9px; color: #f4fbff; background: rgba(22,106,150,.45); font: inherit; }
.collective-source-form { display: grid; gap: 8px; margin: 12px 0; }
.collective-source-form label { display: grid; gap: 6px; font-size: 13px; }
.collective-source-form input { width: 100%; min-height: 40px; padding: 8px; border: 1px solid rgba(136,220,244,.5); border-radius: 8px; background: #072647; color: #fff; font: inherit; }
.collective-feedback { color: #f4c8b9; min-height: 16px; }
body.collective-session-mode .app-shell { padding: 18px 14px; }
.collective-session { padding: 20px; border: 1px solid rgba(154,222,243,.48); border-radius: 22px; color: #f5fbff; background: linear-gradient(135deg,rgba(13,67,110,.82),rgba(4,28,62,.92)); box-shadow: 0 14px 30px rgba(0,7,30,.35); }
.collective-session h1 { margin: 6px 0 10px; font-size: 27px; }
.collective-session p { line-height: 1.4; }
.collective-eyebrow { margin: 0; color: #a6e7f5; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.collective-contribution-form { display: grid; gap: 12px; margin-top: 20px; }
.collective-contribution-form label { display: grid; gap: 8px; font-size: 14px; }
.collective-contribution-form textarea { min-height: 120px; padding: 12px; border: 1px solid rgba(136,220,244,.5); border-radius: 10px; background: rgba(4,27,58,.68); color: #fff; font: inherit; }
.collective-contribution-form.is-photo textarea { min-height: 68px; }
.collective-contribution-form button { min-height: 44px; padding: 10px 12px; border: 1px solid rgba(121,231,240,.55); border-radius: 11px; background: linear-gradient(130deg,rgba(18,146,179,.75),rgba(8,85,141,.74)); color: #fff; font-weight: 750; }
.collective-contribution-form input[type=file] { display: none; }
.collective-picked-photo { display: block; width: 100%; max-height: 300px; object-fit: contain; border: 1px solid rgba(121,231,240,.55); border-radius: 12px; background: rgba(4,27,58,.68); }
.collective-picked-photo[hidden] { display: none; }
.collective-my-status { margin-top: 14px; padding: 12px; border: 1px solid rgba(136,220,244,.3); border-radius: 12px; background: rgba(4,27,58,.42); }
.collective-my-status:empty { display: none; }
.collective-my-status summary { cursor: pointer; color: #c7f4ff; font-size: 14px; font-weight: 700; }
.collective-my-status p { margin: 8px 0 0; font-size: 13px; }
.collective-review-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 8px; }
.collective-review-tabs button { min-height: 44px; padding: 8px 10px; border: 1px solid rgba(103,223,255,.42); border-radius: 12px; background: linear-gradient(145deg,rgba(255,255,255,.09),rgba(4,36,77,.57)); color: #c7e9fa; font: inherit; font-size: 13px; font-weight: 700; backdrop-filter: blur(20px) saturate(165%); }
.collective-review-tabs button[aria-selected="true"] { border-color: rgba(103,223,255,.92); background: linear-gradient(145deg,rgba(41,154,238,.32),rgba(4,44,93,.68)); color: #f8fbff; box-shadow: inset 0 1px 0 rgba(255,255,255,.22),0 0 16px rgba(0,201,255,.34); }
.collective-review-panel[hidden] { display: none !important; }
.collective-card-carousel { min-width: 0; }
.collective-carousel-navigation { display: grid; grid-template-columns: minmax(0,1fr) auto 44px 44px; align-items: center; gap: 7px; padding: 3px 2px 8px; }
.collective-carousel-caption { color: #e9f8ff; font-size: 13px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collective-carousel-progress { color: #b7d4ed; font-size: 12px; white-space: nowrap; }
.collective-carousel-arrow { width: 44px; height: 44px; border: 1px solid rgba(103,223,255,.7); border-radius: 10px; color: #f8fbff; background: linear-gradient(145deg,rgba(45,154,231,.3),rgba(5,41,85,.7)); box-shadow: inset 0 1px 0 rgba(255,255,255,.15),0 0 10px rgba(0,176,255,.2); font: inherit; font-size: 26px; line-height: 1; }
.collective-carousel-arrow:disabled { opacity: .4; box-shadow: none; }
.collective-carousel-viewport { position: relative; display: flex; align-items: flex-start; width: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; scrollbar-width: none; border: 1px solid rgba(103,223,255,.75); border-radius: 16px; background: linear-gradient(145deg,rgba(255,255,255,.10),rgba(5,44,91,.63) 47%,rgba(2,23,53,.72)); box-shadow: inset 0 1px 0 rgba(255,255,255,.21),0 0 17px rgba(0,176,255,.25),0 13px 24px rgba(0,4,24,.28); backdrop-filter: blur(22px) saturate(165%); -webkit-backdrop-filter: blur(22px) saturate(165%); }
.collective-carousel-viewport::-webkit-scrollbar { display: none; }
.collective-carousel-viewport:focus-visible { outline: 2px solid #67dfff; outline-offset: 2px; }
.collective-carousel-viewport .collective-review-item, .collective-carousel-viewport .collective-status-card { box-sizing: border-box; flex: 0 0 100%; width: 100%; margin: 0; scroll-snap-align: start; border-color: rgba(103,223,255,.57); background: linear-gradient(150deg,rgba(255,255,255,.08),rgba(3,35,69,.48)); box-shadow: inset 0 1px 0 rgba(255,255,255,.11),0 0 10px rgba(0,176,255,.14); }
.collective-carousel-viewport .collective-review-item.is-accepted { border-color: rgba(97,224,194,.63); background: linear-gradient(150deg,rgba(117,231,213,.10),rgba(3,46,64,.42)); }
.collective-carousel-viewport .collective-review-item img { max-height: min(27vh,220px); }
.collective-status-card { padding: 14px; border: 1px solid rgba(103,223,255,.57); border-radius: 12px; color: #f8fbff; }
.collective-status-card strong { font-size: 15px; }
.collective-status-card p { overflow-wrap: anywhere; }
.collective-my-status .collective-card-carousel { margin-top: 12px; }
.collective-share-sheet { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 20px; background: rgba(0, 9, 27, .72); }
.collective-share-panel { width: min(100%, 360px); display: grid; gap: 12px; padding: 22px; border: 1px solid rgba(107, 226, 248, .55); border-radius: 18px; background: #082447; color: #f5fbff; box-shadow: 0 18px 48px rgba(0, 5, 20, .55); }
.collective-share-panel p { margin: 0; line-height: 1.45; }
.collective-share-panel button { min-height: 44px; border: 1px solid rgba(107, 226, 248, .55); border-radius: 10px; background: #1166aa; color: #fff; font: inherit; font-weight: 700; }
.collective-share-panel .collective-share-close { background: rgba(255, 255, 255, .08); }
.collective-share-panel button[hidden] { display: none !important; }

/* collective-v2: collective actions lead the case action bar */
.case-detail-work-action.is-collective-primary{font-weight:700;border:1px solid rgba(64,160,255,.55);background:linear-gradient(135deg,rgba(40,130,255,.22),rgba(40,200,255,.12));}
.community-recipient.is-official-chat{border-color:rgba(64,160,255,.6);}
.collective-summary{display:grid;gap:10px;margin:0 0 14px}
.collective-summary-status{margin:0;padding:10px 14px;border-radius:14px;font-weight:800;font-size:1.05rem}
.collective-summary-status[data-tone=good]{background:rgba(30,150,90,.25);color:#b9f5cf}
.collective-summary-status[data-tone=bad]{background:rgba(200,50,60,.25);color:#ffd0d0}
.collective-summary-status[data-tone=wait]{background:rgba(220,160,30,.25);color:#ffe7b0}
.collective-summary-status[data-tone=work]{background:rgba(40,130,200,.25);color:#d6f2ff}
.collective-summary-counters{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;text-align:center;font-size:.78rem;opacity:.95}
.collective-summary-counters span{display:grid;gap:2px;padding:8px 2px;border-radius:12px;background:rgba(255,255,255,.06)}
.collective-summary-counters strong{font-size:1.25rem}
.collective-summary-handed{margin:0;font-size:.85rem;opacity:.85}
[data-theme=light] .collective-summary-status[data-tone=good]{color:#0d5a31}[data-theme=light] .collective-summary-status[data-tone=bad]{color:#8a1620}[data-theme=light] .collective-summary-status[data-tone=wait]{color:#6b4a00}[data-theme=light] .collective-summary-status[data-tone=work]{color:#0b4a73}

/* «➕ Дополнить»: выбор между фото и комментарием */
.collective-choose { display: grid; gap: 12px; }
.collective-choose button { width: 100%; min-height: 56px; font-size: 17px; font-weight: 700; border-radius: 16px; }

/* Предпросмотр текста обращения перед отправкой в чат */
.collective-share-preview { max-height: 46vh; overflow: auto; white-space: pre-wrap; text-align: left;
  font-size: 14px; line-height: 1.45; padding: 12px 14px; border-radius: 14px;
  background: rgba(127, 160, 200, .12); border: 1px solid rgba(127, 160, 200, .28); }
.collective-share-hint { font-size: 12.5px; opacity: .8; margin: 2px 0 6px; }

/* Уведомление после отправки карточки в чат (приложение остаётся открытым). */
.collective-notice{position:fixed;left:16px;right:16px;bottom:calc(96px + env(safe-area-inset-bottom,0px));z-index:9999;padding:14px 16px;border-radius:16px;background:rgba(20,40,70,.92);color:#fff;font-size:.95rem;line-height:1.35;box-shadow:0 10px 30px rgba(0,0,0,.25);transition:opacity .5s,transform .5s}
.collective-notice.is-hidden{opacity:0;transform:translateY(8px)}
