/* ============================================
   TRUST MAP — expanded rating card in profile modal
   Replaces the collapsed <details> block.
   Uses tokens from base.css; no new design primitives.
   ============================================ */

.tg-trust-map{
  border:1px solid var(--border);
  border-radius:var(--r-lg);
  background:
    radial-gradient(ellipse at top right, rgba(38,217,127,0.05), transparent 60%),
    linear-gradient(180deg, var(--bg-panel-2), var(--bg-panel));
  padding:18px 18px 14px;
  position:relative;overflow:hidden;
}

/* === Label «Рейтинг» + info-кнопка с тултипом === */
.tg-trust-label{
  display:inline-flex;align-items:center;gap:8px;
  position:relative;margin-bottom:14px;
}
.tg-trust-label-text{
  font-family:var(--mono);
  font-size:10.5px;font-weight:700;
  letter-spacing:0.16em;text-transform:uppercase;
  color:var(--text-3);
  display:inline-flex;align-items:center;gap:8px;
}
.tg-trust-label-text::before{
  content:"";width:6px;height:6px;border-radius:50%;
  background:var(--green);box-shadow:0 0 8px var(--green-glow);
}
.tg-trust-info{
  width:17px;height:17px;border-radius:50%;flex-shrink:0;
  display:inline-grid;place-items:center;line-height:1;
  font-family:var(--mono);font-size:11px;font-weight:700;font-style:normal;
  color:var(--text-3);background:rgba(255,255,255,0.06);
  border:1px solid var(--border);cursor:pointer;
  transition:color .15s, border-color .15s, background .15s;
}
.tg-trust-info:hover,
.tg-trust-info[aria-expanded="true"]{
  color:var(--green-hi);border-color:rgba(38,217,127,0.5);
  background:rgba(38,217,127,0.12);
}
.tg-trust-tip{
  position:absolute;top:calc(100% + 9px);left:0;z-index:6;
  width:min(290px,76vw);
  background:var(--bg-panel-2,#11161f);
  border:1px solid var(--border);border-radius:12px;
  padding:11px 13px;
  font-family:var(--sans,inherit);font-size:12.5px;font-weight:400;
  line-height:1.5;letter-spacing:normal;text-transform:none;
  color:var(--text-2);
  box-shadow:0 18px 42px -18px rgba(0,0,0,0.85);
}
.tg-trust-tip::before{
  content:"";position:absolute;top:-5px;left:5px;width:9px;height:9px;
  background:var(--bg-panel-2,#11161f);
  border-left:1px solid var(--border);border-top:1px solid var(--border);
  transform:rotate(45deg);
}

/* === Header: big score + overall scale === */
.tg-trust-head{
  display:flex;align-items:center;gap:16px;
  margin-bottom:18px;flex-wrap:wrap;
}

.tg-trust-score{
  display:flex;align-items:baseline;gap:4px;flex-shrink:0;
}
.tg-trust-score-num{
  font-family:var(--display);
  font-size:48px;font-weight:800;
  line-height:1;letter-spacing:-0.04em;
  background:linear-gradient(180deg, var(--green-hi), var(--green));
  -webkit-background-clip:text;background-clip:text;color:transparent;
  font-variant-numeric:tabular-nums;
}
.tg-trust-score-suffix{
  font-family:var(--mono);
  font-size:14px;color:var(--text-3);font-weight:600;
}

.tg-trust-scale{
  flex:1;min-width:160px;
  display:flex;flex-direction:column;gap:6px;
}
.tg-trust-scale-bar{
  display:flex;gap:3px;align-items:center;
}
.tg-trust-scale-seg{
  flex:1;height:8px;border-radius:3px;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--border);
  transition:background 0.45s ease, border-color 0.45s ease;
}
.tg-trust-scale-seg[data-fill="high"]{
  background:linear-gradient(180deg, var(--green-hi), var(--green));
  border-color:rgba(38,217,127,0.45);
  box-shadow:0 0 6px rgba(38,217,127,0.4);
}
.tg-trust-scale-seg[data-fill="mid"]{
  background:linear-gradient(180deg, var(--amber-hi), var(--amber));
  border-color:rgba(245,185,66,0.45);
}
.tg-trust-scale-seg[data-fill="low"]{
  background:#ff5757;
  border-color:rgba(255,87,87,0.45);
}
.tg-trust-scale-label{
  font-family:var(--mono);font-size:10px;
  color:var(--text-3);letter-spacing:0.08em;text-transform:uppercase;
}

/* === Criterion rows === */
.tg-trust-list{
  display:flex;flex-direction:column;
}
.tg-trust-row{
  display:grid;
  grid-template-columns:auto 1fr auto;
  grid-template-areas:
    "icon  text  score"
    ".     bar   bar"
    ".     reason reason";
  column-gap:12px;row-gap:8px;
  padding:14px 0;
  border-top:1px solid var(--border);
}
.tg-trust-row:first-child{border-top:1px solid rgba(255,255,255,0.08)}

.tg-trust-icon-wrap{grid-area:icon}
.tg-trust-icon{
  width:36px;height:36px;border-radius:10px;
  display:grid;place-items:center;
  font-size:17px;
  border:1px solid;
  background:linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
}
.tg-trust-icon[data-bucket="high"]{
  background:linear-gradient(180deg, rgba(38,217,127,0.12), rgba(38,217,127,0.04));
  border-color:rgba(38,217,127,0.3);
  color:var(--green-hi);
}
.tg-trust-icon[data-bucket="mid"]{
  background:linear-gradient(180deg, rgba(245,185,66,0.12), rgba(245,185,66,0.04));
  border-color:rgba(245,185,66,0.3);
  color:var(--amber-hi);
}
.tg-trust-icon[data-bucket="low"]{
  background:linear-gradient(180deg, rgba(255,87,87,0.12), rgba(255,87,87,0.04));
  border-color:rgba(255,87,87,0.3);
  color:#ff8a8a;
}
.tg-trust-icon[data-bucket="empty"]{
  background:rgba(255,255,255,0.03);
  border-color:var(--border);
  color:var(--text-3);
}

.tg-trust-text{grid-area:text;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:2px}
.tg-trust-name{
  font-family:var(--display);font-weight:700;
  font-size:15px;color:var(--text);
  letter-spacing:-0.01em;line-height:1.2;
}
.tg-trust-hint{
  font-size:12.5px;color:var(--text-3);
  line-height:1.3;
}

.tg-trust-score-cell{
  grid-area:score;align-self:center;
  font-family:var(--mono);font-weight:700;
  font-size:18px;font-variant-numeric:tabular-nums;
  letter-spacing:-0.01em;
  white-space:nowrap;
}
.tg-trust-score-cell .sl{color:var(--text-3);font-size:11px;font-weight:600;margin-left:2px}

.tg-trust-score-cell[data-bucket="high"]{color:var(--green-hi)}
.tg-trust-score-cell[data-bucket="mid"]{color:var(--amber-hi)}
.tg-trust-score-cell[data-bucket="low"]{color:#ff8a8a}
.tg-trust-score-cell[data-bucket="empty"]{color:var(--text-3)}

/* Progress bar */
.tg-trust-bar{
  grid-area:bar;
  height:6px;border-radius:999px;
  background:rgba(255,255,255,0.04);
  border:1px solid var(--border);
  overflow:hidden;position:relative;
}
.tg-trust-bar-fill{
  display:block;height:100%;width:var(--fill, 0%);
  border-radius:inherit;
  transform-origin:left center;
  animation:tg-trust-grow 700ms cubic-bezier(.22,1,.36,1) both;
}
.tg-trust-bar-fill[data-bucket="high"]{
  background:linear-gradient(90deg, var(--green), var(--green-hi));
  box-shadow:0 0 6px rgba(38,217,127,0.45);
}
.tg-trust-bar-fill[data-bucket="mid"]{
  background:linear-gradient(90deg, var(--amber), var(--amber-hi));
}
.tg-trust-bar-fill[data-bucket="low"]{
  background:linear-gradient(90deg, #ff5757, #ff8a8a);
}
.tg-trust-bar-fill[data-bucket="empty"]{display:none}

@keyframes tg-trust-grow{
  0%   {transform:scaleX(0)}
  100% {transform:scaleX(1)}
}
/* Animation honors prefers-reduced-motion */
@media (prefers-reduced-motion: reduce){
  .tg-trust-bar-fill{animation:none}
}

.tg-trust-reason{
  grid-area:reason;
  font-size:13px;line-height:1.5;
  color:var(--text-2);
  background:rgba(255,255,255,0.025);
  border-left:2px solid var(--border-hi);
  padding:8px 10px;border-radius:8px;
  margin-top:2px;
}

/* === Footer chip links === */
.tg-trust-footer{
  display:flex;gap:8px;flex-wrap:wrap;
  margin-top:14px;padding-top:14px;
  border-top:1px dashed var(--border);
}
.tg-trust-chip{
  display:inline-flex;align-items:center;gap:6px;
  padding:7px 12px;border-radius:999px;
  background:rgba(255,255,255,0.03);
  border:1px solid var(--border);
  font-size:12px;font-weight:600;color:var(--text-2);
  text-decoration:none;letter-spacing:0;
  transition:all 0.15s ease;
}
.tg-trust-chip:hover{
  border-color:rgba(38,217,127,0.35);
  color:var(--green-hi);background:rgba(38,217,127,0.05);
}
.tg-trust-chip-arrow{font-family:var(--mono);font-weight:700;opacity:0.7}

/* === Mobile === */
@media (max-width: 640px){
  .tg-trust-map{padding:14px 14px 12px;border-radius:var(--r-md)}
  .tg-trust-head{gap:12px}
  .tg-trust-score-num{font-size:38px}
  .tg-trust-row{
    grid-template-columns:auto 1fr;
    grid-template-areas:
      "icon  text"
      "icon  score"
      "bar   bar"
      "reason reason";
    row-gap:6px;
  }
  .tg-trust-score-cell{justify-self:start;font-size:15px}
  .tg-trust-name{font-size:14px}
  .tg-trust-hint{font-size:12px}
  .tg-trust-reason{font-size:12.5px}
  .tg-trust-scale-seg{height:6px}
}

/* ============================================
   ARTICLES LIST (в модалке профиля)
   ============================================ */
.tg-articles-list{
  list-style:none;margin:0;padding:0;
  display:flex;flex-direction:column;gap:8px;
}
.tg-articles-item a{
  display:flex;align-items:flex-start;gap:12px;justify-content:space-between;
  padding:10px 14px;border-radius:10px;
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.06);
  text-decoration:none;color:inherit;
  transition:all .15s ease;
}
.tg-articles-item a:hover{
  background:rgba(38,217,127,0.07);
  border-color:rgba(38,217,127,0.25);
}
.tg-articles-title{
  font-size:14px;font-weight:500;color:var(--text);line-height:1.4;flex:1;
}
.tg-articles-date{
  font-size:11.5px;color:var(--text-3);font-family:var(--mono);
  white-space:nowrap;letter-spacing:0.02em;
}
