/* ─────────────────────────────────────────────────────────────────────────
   Отзывы и вопросы — layered on top of styles.css (shared tokens/shell).
   ───────────────────────────────────────────────────────────────────────── */

.nav-link-ext { text-decoration: none; }

/* Sub-tabs (Отзывы / Вопросы) */
.subtabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 11px; width: fit-content; }
.subtab { font: inherit; font-weight: 550; border: none; background: transparent; color: var(--text-2); padding: 7px 16px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background .12s, color .12s; }
.subtab:hover { color: var(--text); }
.subtab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.subtab .pill { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; }
.subtab .pill.zero { display: none; }

/* Filter bar */
.fbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 16px; }
.fgroup { display: flex; align-items: center; gap: 6px; }
.fgroup > .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-right: 2px; }

/* Segmented control */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { font: inherit; font-size: 12.5px; font-weight: 550; border: none; background: transparent; color: var(--text-2); padding: 6px 12px; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .12s, color .12s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button .c { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg button.on .c { color: var(--text-2); }

/* Star filter chips */
.starchips { display: inline-flex; gap: 5px; }
.starchip { font: inherit; font-size: 12.5px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); border-radius: 8px; padding: 5px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: all .12s; }
.starchip .s { color: #f5b301; letter-spacing: -1px; }
.starchip .c { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.starchip:hover { border-color: var(--muted); }
.starchip.on { background: color-mix(in srgb, #f5b301 14%, var(--surface)); border-color: #f5b301; color: var(--text); }

/* Product combobox */
.pcombo { position: relative; }
.pcombo-trigger { min-width: 200px; max-width: 280px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcombo-trigger .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcombo-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 340px; max-height: 360px; overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lift); padding: 6px; }
.pcombo-pop input { margin-bottom: 6px; }
.pcombo-item { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.pcombo-item:hover, .pcombo-item.sel { background: var(--surface-2); }
.pcombo-item .pi-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pcombo-item .pi-name b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcombo-item .pi-sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcombo-item .pi-c { font-size: 11px; color: var(--muted); flex-shrink: 0; }

.daterange { display: inline-flex; align-items: center; gap: 6px; }
.presets { display: inline-flex; gap: 4px; }
.preset { font: inherit; font-size: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); border-radius: 7px; padding: 5px 9px; cursor: pointer; }
.preset:hover { color: var(--text); border-color: var(--muted); }
.preset.on { background: var(--accent); color: var(--surface); border-color: transparent; }

.fbar-search { min-width: 200px; flex: 1; }

/* List */
.reviews-list, .questions-list { display: flex; flex-direction: column; gap: 14px; }
.list-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; padding: 2px 2px; }

/* Card */
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px 20px; display: flex; flex-direction: column; gap: 13px; animation: fade .3s ease both; }
.rcard.unans { border-left: 3px solid var(--warn); }
.rcard-head { display: flex; align-items: flex-start; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 650; font-size: 15px; color: #fff; }
.rc-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rc-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.rc-sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stars { color: #f5b301; letter-spacing: 1px; font-size: 14px; }
.stars .off { color: var(--line-2); }
.rc-spacer { flex: 1; }
.rc-flags { display: flex; align-items: center; gap: 8px; }
.dot-new { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent); }
.badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.cab { background: var(--link-soft); color: var(--link); }
.badge.buyout { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.badge.rejected { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }

.rc-product { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border-radius: 9px; padding: 8px 11px; flex-wrap: wrap; }
.rc-product .pn { font-weight: 550; color: var(--text); }
.rc-product a { color: var(--link); text-decoration: none; }
.rc-product a:hover { text-decoration: underline; }
.rc-product .sep { color: var(--line-2); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--link) 8%, var(--surface-2)); color: var(--text-2); }

.rc-body { font-size: 14px; line-height: 1.6; }
.rc-body .pc { display: flex; gap: 8px; margin-top: 4px; }
.rc-body .pc .mark { font-weight: 700; flex-shrink: 0; }
.rc-body .pc.pros .mark { color: var(--good); }
.rc-body .pc.cons .mark { color: var(--bad); }
.rc-body .empty-txt { color: var(--muted); font-style: italic; }

/* Media strip */
.media-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.media-thumb { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--surface-2); border: 1px solid var(--line); }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.media-thumb:hover img { transform: scale(1.06); }
.media-thumb.video::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 20px; background: rgba(0,0,0,.32); text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.media-thumb .dur { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.7); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 5px; z-index: 2; }
.media-thumb.more { display: grid; place-items: center; color: var(--text-2); font-weight: 600; }

/* Answer block */
.answer-box { border-top: 1px dashed var(--line-2); padding-top: 12px; }
.answer-shown { background: var(--surface-2); border-radius: 10px; padding: 11px 13px; font-size: 13.5px; line-height: 1.55; }
.answer-shown .ah { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.answer-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.answer-edit textarea { width: 100%; min-height: 84px; resize: vertical; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); line-height: 1.5; }
.answer-edit textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px var(--link-soft); }
.answer-edit .ae-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.answer-edit .cnt { font-size: 11px; color: var(--muted); margin-left: auto; }

/* Question card variant */
.qcard .q-text { font-size: 15px; line-height: 1.55; font-weight: 500; }

/* ── Templates management ── */
.tpl-editor-card { display: flex; flex-direction: column; gap: 11px; }
.tpl-body { min-height: 96px; resize: vertical; line-height: 1.5; font: inherit; }
.tpl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 13px; margin-top: 14px; }
.tpl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 15px 17px; display: flex; flex-direction: column; gap: 8px; }
.tpl-card .tc-title { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.tpl-card .tc-body { font-size: 13px; color: var(--text-2); line-height: 1.5; white-space: pre-wrap; max-height: 120px; overflow: hidden; position: relative; }
.tpl-card .tc-actions { display: flex; gap: 8px; margin-top: 2px; }
.tpl-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 20px; }

/* ── Template button + picker popup (inside the answer editor) ── */
.tpl-btn { display: inline-flex; align-items: center; gap: 6px; }
.tpl-anchor { position: relative; display: inline-flex; }
.tpl-pop { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 60; width: 340px; max-height: 340px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 13px; box-shadow: var(--shadow-lift); padding: 7px; animation: fade .14s ease; }
.tpl-pop-head { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 5px 9px 7px; }
.tpl-pop-item { padding: 9px 11px; border-radius: 9px; cursor: pointer; transition: background .12s; }
.tpl-pop-item:hover { background: var(--surface-2); }
.tpl-pop-item .ti-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.tpl-pop-item .ti-body { font-size: 12px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-pop-empty { padding: 18px 12px; text-align: center; color: var(--muted); font-size: 12.5px; }
.tpl-pop-empty a { color: var(--link); cursor: pointer; }

/* Empty / skeleton */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .em-ic { font-size: 34px; opacity: .4; margin-bottom: 8px; }
.skeleton { height: 150px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* Infinite scroll */
.scroll-sentinel { height: 1px; }
.list-status { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 18px 8px 8px; color: var(--muted); font-size: 12.5px; min-height: 24px; }
.list-status.done { color: var(--muted); opacity: .7; }

/* ── Lightbox (photos) ── */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.9); display: flex; flex-direction: column; animation: fade .2s ease; }
.lb-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; color: #fff; }
.lb-count { font-size: 14px; font-variant-numeric: tabular-nums; opacity: .85; }
.lb-close { background: rgba(255,255,255,.12); border: none; color: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; cursor: pointer; }
.lb-close:hover { background: rgba(255,255,255,.22); }
.lb-stage { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; padding: 0 16px 16px; }
.lb-stage img { max-width: 94vw; max-height: 82vh; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); cursor: zoom-in; transition: transform .2s; }
.lb-stage img.zoomed { cursor: zoom-out; max-width: none; max-height: none; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.14); border: none; color: #fff; font-size: 26px; cursor: pointer; display: grid; place-items: center; }
.lb-nav:hover { background: rgba(255,255,255,.26); }
.lb-prev { left: 18px; } .lb-next { right: 18px; }
.lb-thumbs { display: flex; gap: 8px; padding: 12px 20px 20px; overflow-x: auto; justify-content: center; }
.lb-thumbs img { width: 54px; height: 54px; object-fit: cover; border-radius: 7px; cursor: pointer; opacity: .5; border: 2px solid transparent; }
.lb-thumbs img.on { opacity: 1; border-color: #fff; }

/* ── Video player ── */
.vplayer { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.92); display: grid; place-items: center; animation: fade .2s ease; }
.vp-shell { width: min(92vw, 900px); background: #000; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.7); position: relative; }
.vp-close { position: absolute; top: 10px; right: 10px; z-index: 6; background: rgba(0,0,0,.5); border: none; color: #fff; width: 38px; height: 38px; border-radius: 50%; font-size: 19px; cursor: pointer; }
.vp-close:hover { background: rgba(0,0,0,.75); }
.vp-video-wrap { position: relative; background: #000; }
.vp-video-wrap video { width: 100%; max-height: 78vh; display: block; }
.vp-big-play { position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer; }
.vp-big-play span { width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,.9); color: #111; display: grid; place-items: center; font-size: 28px; padding-left: 4px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.vp-controls { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #0d0d0f; color: #fff; }
.vp-controls button { background: transparent; border: none; color: #fff; cursor: pointer; font-size: 16px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; }
.vp-controls button:hover { background: rgba(255,255,255,.14); }
.vp-time { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .85; white-space: nowrap; }
.vp-seek { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.22); position: relative; cursor: pointer; }
.vp-seek .buf { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.28); border-radius: 3px; }
.vp-seek .played { position: absolute; left: 0; top: 0; bottom: 0; background: var(--link); border-radius: 3px; }
.vp-seek .knob { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 1px 4px rgba(0,0,0,.5); }

.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--line-2); border-top-color: var(--link); border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* Auto-refresh chip */
.refresh-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.refresh-chip .live { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .nav-links { flex-direction: row; }
  .media-thumb { width: 64px; height: 64px; }
}
