/* дополнительные стили: group — чат, голосования, вещи и задачи, маршрут (префикс .gr-) */

/* ---------- общее ---------- */
.gr-quote{background:var(--surface-2);border-radius:12px;padding:10px 12px;white-space:pre-wrap;max-height:40vh;overflow:auto}
.gr-right{margin-left:auto}
.gr-flash{outline:3px solid transparent;outline-offset:-3px;animation:gr-flash 2.6s ease-out}
@keyframes gr-flash{0%,45%{outline-color:var(--accent)}100%{outline-color:transparent}}

/* ---------- чат ---------- */
.subview.gr-chat-box{padding:0}
.gr-chat-wrap{display:flex;flex-direction:column;min-height:calc(100vh - var(--header-h) - var(--safe-t) - 56px - var(--tabbar-h) - var(--safe-b));min-height:calc(100dvh - var(--header-h) - var(--safe-t) - 56px - var(--tabbar-h) - var(--safe-b))}
.gr-chat{flex:1;justify-content:flex-end}
.gr-chat .empty{align-self:center}
.gr-chat-top{display:flex;justify-content:center;padding:10px 12px 0}
.gr-chat .msg{cursor:default}
.gr-chat .msg[tabindex]{cursor:pointer}
.gr-chat .msg[tabindex]:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.gr-chat .msg.gr-cont{margin-top:-3px}
.gr-chat .msg a{color:var(--river)}
.gr-chat .msg .files a{display:block}
.gr-chat .msg .gr-file{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:10px;background:var(--surface-2);color:var(--ink);text-decoration:none;font-size:.9rem;max-width:100%;white-space:normal}
.gr-chat .msg.system.gr-ref{appearance:none;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:16px;padding:10px 16px;font:inherit;font-size:.9rem;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:4px;white-space:normal;min-height:44px}
.gr-chat .msg.system.gr-ref:active{filter:brightness(.95)}
.gr-ref-go{color:var(--primary);font-weight:600;font-size:.85rem}
.gr-chat .msg.gr-failed{border:1px solid var(--danger)}
.gr-fail{color:var(--danger);margin-top:6px;white-space:normal}
.gr-fail .btn-row{margin-top:6px}

.gr-dock{position:sticky;bottom:calc(var(--tabbar-h) + var(--safe-b));z-index:5;background:var(--bg);border-top:1px solid var(--line);padding:6px 8px 8px}
.gr-dock .composer{position:static;border-top:0;padding:0;background:transparent}
.gr-quick{display:flex;gap:8px;padding:0 0 6px;overflow-x:auto;scrollbar-width:none}
.gr-quick::-webkit-scrollbar{display:none}
.gr-quick .chip{min-height:36px;padding:5px 12px;font-size:.88rem}
.gr-attach{flex-shrink:0;color:var(--muted)}
.gr-send{width:48px;min-width:48px;height:48px;padding:0;flex-shrink:0}
.gr-send svg{width:22px;height:22px}
.gr-chosen{display:flex;gap:6px;flex-wrap:wrap;padding-bottom:6px}
.gr-chip{max-width:100%;padding:2px 2px 2px 10px}
.gr-chip .ellipsis{max-width:200px}
.gr-x{appearance:none;border:0;background:none;color:var(--muted);width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;border-radius:50%;flex-shrink:0}
.gr-offline{margin:0 0 6px;font-size:.88rem}
.gr-newbtn{position:absolute;left:50%;top:-52px;transform:translateX(-50%);box-shadow:var(--shadow);white-space:nowrap}

/* ---------- голосования ---------- */
.gr-poll .card-body{display:flex;flex-direction:column;gap:10px}
.gr-poll .opt{margin-bottom:0;min-height:56px}
.gr-poll .opt.gr-locked{cursor:default}
.gr-poll .opt.gr-can:active{filter:brightness(.95)}
.gr-poll .opt:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.gr-poll.gr-closed .opt:not(.winner){opacity:.85}
.gr-poll-badges{gap:6px}
.gr-q{margin:0;font-size:1.12rem}
.gr-by{margin-top:-6px}
.gr-mark{width:24px;height:24px;border-radius:50%;border:2px solid var(--muted);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;font-size:.85rem;font-weight:700;line-height:1}
.gr-mark.sq{border-radius:7px}
.gr-mark.on{background:var(--primary);border-color:var(--primary);color:var(--primary-ink)}
.gr-opt-text{font-weight:500;display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px}
.gr-mine{font-size:.72rem;padding:2px 8px}
.gr-num{text-align:right;flex-shrink:0;min-width:58px;line-height:1.2}
.gr-voters{display:flex;align-items:center;gap:6px;margin-top:4px;min-width:0}
.gr-voters .avatar.s{width:24px;height:24px;font-size:.62rem}
.gr-edit{width:40px;height:40px;margin:-6px -8px -6px 0;color:var(--muted);flex-shrink:0}
.gr-result{display:flex;gap:8px;align-items:flex-start;margin:0}
.gr-result .i{margin-top:.15em;color:var(--accent)}
.gr-turnout{display:flex;flex-direction:column;gap:6px}
.gr-radios{display:flex;flex-direction:column;gap:6px}
.gr-radio{padding:6px 12px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.gr-radio:has(input:checked){border-color:var(--primary)}
.gr-optinputs{gap:8px}
.gr-optinput{display:flex;gap:4px;align-items:center}
.gr-optinput .icon-btn{flex-shrink:0;color:var(--muted)}

/* ---------- вещи и задачи ---------- */
.gr-summary{display:flex;flex-direction:column;gap:10px}
.gr-sum-top{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
.gr-sum-big{font-size:1.25rem;font-weight:700;line-height:1.2}
.gr-sum-pct{font-size:1.6rem;font-weight:700;color:var(--primary);line-height:1}
.gr-sum-links{display:flex;gap:8px}
.gr-stat{flex:1;appearance:none;border:1px solid var(--line);background:var(--surface-2);color:var(--ink);border-radius:14px;padding:8px 12px;font:inherit;display:flex;align-items:baseline;gap:6px;cursor:pointer;min-height:48px;text-align:left}
.gr-stat b{font-size:1.3rem}
.gr-stat.warn b{color:var(--warn)}
.gr-filters{margin-top:4px}
.gr-sec .section-title{margin-top:18px}
.gr-sec-add{flex-shrink:0}
.gr-sec-empty{padding:2px 4px 8px}
.gr-task{align-items:flex-start}
.gr-task-title{font-weight:600;display:flex;flex-wrap:wrap;gap:2px 8px;align-items:baseline}
.gr-qty{font-weight:500;color:var(--river);white-space:nowrap}
.gr-desc{margin-top:2px;white-space:pre-wrap}
.gr-task-meta{margin-top:6px;gap:6px 10px}
.gr-who{display:inline-flex;align-items:center;gap:6px;font-size:.9rem}
.gr-comment{display:flex;gap:6px;align-items:flex-start;margin-top:6px;color:var(--muted)}
.gr-comment .i{margin-top:.2em}
.gr-task-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.gr-task.gr-done .gr-task-title>span:first-child{text-decoration:line-through;text-decoration-color:var(--muted)}
.gr-task.gr-done{opacity:.8}
.gr-task.gr-cancel{opacity:.55}
.gr-task.gr-minerow{box-shadow:inset 3px 0 0 var(--primary)}
.gr-more{margin:-6px -8px 0 0;color:var(--muted);flex-shrink:0}
.gr-kotelok{display:block;margin-top:20px;text-decoration:none;color:inherit}
.gr-kot-title{display:flex;align-items:center;gap:10px;font-weight:600;color:var(--primary);margin-bottom:4px}

/* ---------- маршрут ---------- */
.gr-routepage>.gr-block:first-child .section-title{margin-top:4px}
.gr-head-btn{appearance:none;background:none;border:0;font:inherit;font-size:.95rem;font-weight:500;color:var(--primary);display:inline-flex;align-items:center;gap:6px;cursor:pointer;min-height:44px;padding:0 4px}
.gr-meet-btns{margin-top:4px}
.gr-meet-btns>.btn{flex:1 1 200px}
.gr-privacy,.gr-mapnote{display:flex;gap:6px;align-items:center;margin-top:10px}
.gr-route{list-style:none;margin:0 0 12px;padding:4px 16px;background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow)}
.gr-pt{display:flex;gap:12px;align-items:flex-start;padding:12px 0;position:relative}
.gr-pt+.gr-pt{border-top:1px solid var(--line)}
.gr-pt::before{content:"";position:absolute;left:15px;top:0;bottom:0;width:2px;background:var(--line)}
.gr-pt:first-child::before{top:28px}
.gr-pt:last-child::before{bottom:auto;height:28px}
.gr-pt-dot{position:relative;z-index:1;width:32px;height:32px;border-radius:50%;background:var(--primary-soft);color:var(--primary);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:.9rem;flex-shrink:0}
.gr-end .gr-pt-dot{background:var(--primary);color:var(--primary-ink)}
.gr-pt-name{font-weight:600}
.gr-maplink{display:inline-flex;align-items:center;gap:6px;margin-top:4px;color:var(--river);text-decoration:none;min-height:36px}
.gr-pt-tools{display:flex;flex-shrink:0;margin:-6px -8px 0 0}
.gr-pt-tools .icon-btn{width:40px;height:40px;color:var(--muted)}
.gr-pt-tools .icon-btn[disabled]{opacity:.3;cursor:default}
.gr-up{transform:rotate(180deg)}
.gr-safety{display:flex;gap:10px;align-items:flex-start;margin:20px 0 8px}
.gr-safety .i{margin-top:.2em;color:var(--warn)}
.gr-car{align-items:flex-start}
.gr-car-title{font-weight:600;display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.gr-riders{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:6px}
.gr-person{display:inline-flex;align-items:center;gap:6px}
.gr-noseat{display:flex;flex-direction:column;gap:4px}

/* Фотогалерея похода */
.gr-shot{appearance:none;border:0;padding:0;width:112px;height:112px;border-radius:14px;overflow:hidden;background:var(--surface-2);cursor:pointer}
.gr-shot img{width:100%;height:100%;object-fit:cover}

/* Карта (OpenStreetMap / Leaflet) */
.gr-map{height:260px;border-radius:var(--radius);overflow:hidden;background:var(--surface-2);z-index:0}
.gr-map-pick{height:min(58vh,460px)}
.gr-mapwrap{display:flex;flex-direction:column;gap:6px}
.gr-mk{background:none;border:0}
.gr-mk-dot{display:flex;width:32px;height:32px;border-radius:50%;align-items:center;justify-content:center;font:700 .85rem/1 Rubik,sans-serif;color:#0b1a12;background:#5fd497;border:2px solid #fff;box-shadow:0 2px 8px rgba(0,0,0,.45)}
.gr-mk-meet{background:#f2a65a}
.gr-mk-end{background:#fff;color:#111}
:root:not([data-theme="light"]) .gr-map .leaflet-tile-pane{filter:brightness(.82) contrast(1.05) saturate(.9)}
.gr-map .leaflet-control-attribution{font-size:10px}
.gr-hint{color:var(--primary);display:flex;align-items:center;gap:4px;margin-top:2px}
.gr-hint svg{width:14px;height:14px}

/* Таблицы из чата */
.gr-file-table{appearance:none;border:0;font:inherit;cursor:pointer;text-align:left}
.gr-table-wrap{overflow:auto;max-height:60vh;border:1px solid var(--line);border-radius:var(--radius-sm)}
.gr-table{border-collapse:collapse;font-size:.88rem;min-width:100%}
.gr-table th,.gr-table td{padding:6px 10px;border-bottom:1px solid var(--line);text-align:left;white-space:nowrap}
.gr-table th{position:sticky;top:0;background:var(--surface-2);font-weight:600}

/* ===== Питание (меню похода) ===== */
.fd{display:flex;flex-direction:column;gap:12px}
.fd-title{font-size:1.2rem;font-weight:700}
.fd-status.fd-ok{color:var(--primary)} .fd-status.fd-err{color:var(--danger)}
.fd-people{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px}
.fd-people label{display:inline-flex;align-items:center;gap:6px}
.fd-num{width:64px;min-height:40px;padding:6px 8px;text-align:center}
.fd-cooks{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:var(--muted)}
.fd-cooks svg{width:18px;height:18px}
.fd-day{display:flex;flex-direction:column;gap:10px;margin:0}
.fd-row{display:flex;align-items:center;gap:6px}
.fd-row .input{flex:1;min-width:0}
.fd-dayname{font-weight:700;font-size:1.05rem}
.fd-dayname-ro{font-weight:700;font-size:1.1rem}
.fd-meal{border-left:3px solid var(--primary-soft);padding-left:10px;display:flex;flex-direction:column;gap:8px}
.fd-mealname{font-weight:600;color:var(--primary)}
.fd-mealname-ro{font-weight:600;color:var(--primary);text-transform:lowercase}
.fd-dish{background:var(--surface-2);border-radius:var(--radius-sm);padding:8px;display:flex;flex-direction:column;gap:6px}
.fd-dishname{font-weight:600}
.fd-dish-ro{padding:2px 0}
.fd-dishname-ro{font-weight:600}
.fd-item{display:grid;grid-template-columns:1fr 64px 64px 36px;gap:4px;align-items:center}
.fd-item .input{min-height:40px;padding:6px 8px;font-size:.95rem;min-width:0}
.fd-qty{text-align:right}
.fd-del{width:36px;height:36px;color:var(--muted)}
.fd-del svg{width:18px;height:18px}
.fd-buy{gap:10px}
.fd-qtycell{white-space:nowrap;text-align:right}
.fd-buyer{display:inline-flex;align-items:center;gap:2px;color:var(--primary)}
.fd-people label{white-space:nowrap}
.fd-people input.fd-num{width:64px;flex:0 0 64px}
.fd-item{grid-template-columns:1fr 50px 58px 30px;gap:3px}
.fd-item .input{padding:6px 6px}
.fd-del{width:30px;height:36px}
.fd-meal{padding-left:8px}
.fd-dish{padding:6px}

/* Маршруты */
.rt-card{gap:10px}
.rt-card .badge{flex-shrink:0}
