/* ══════════════════════════════════════════════════════════════
   proxyview.css — the proxy details view (proxyview.js), styled
   after the app: round flag header, white cards with soft rows,
   solid Copy buttons, and a three-way bar at the bottom.
   Colours come from app.css, so light and dark both work.
   ══════════════════════════════════════════════════════════════ */
.pv{display:flex;flex-direction:column;gap:14px}

/* header */
.pv-head{display:flex;align-items:center;gap:16px;padding:4px 2px 2px}
.pv-flag{width:56px;height:56px;flex:0 0 56px;border-radius:50%;overflow:hidden;
  background:var(--panel-3);box-shadow:0 0 0 1px var(--line)}
.pv-flag img{width:100%;height:100%;object-fit:cover;display:block}
.pv-title{min-width:0}
.pv-title b{display:block;font-size:17px;font-weight:700;letter-spacing:.4px;line-height:1.3;
  overflow-wrap:anywhere}
.pv-title span{display:block;margin-top:3px;font-size:13px;color:var(--text-2)}

/* cards */
.pv-card{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:6px 16px 8px}
.pv-card h4{margin:0;padding:12px 0 11px;font-size:13.5px;font-weight:600;color:var(--text-2);
  border-bottom:1px solid var(--line-2)}
.pv-row{display:flex;align-items:center;gap:12px;padding:10px 0;border-top:1px solid var(--line-2)}
.pv-card h4 + .pv-row{border-top:0}
.pv-ico{width:34px;height:34px;flex:0 0 34px;border-radius:9px;display:grid;place-items:center;
  background:var(--panel-3);color:var(--text-2)}
.pv-ico svg{width:18px;height:18px}
.pv-txt{flex:1;min-width:0;font-size:13.5px;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pv-k{color:var(--text-2)}
.pv-gap{display:inline-block;width:14px}
.pv-copy{flex:0 0 auto;min-width:76px;padding:9px 14px;border-radius:10px;font-size:13px;font-weight:700;
  background:var(--text);color:var(--bg);border:0;cursor:pointer;transition:opacity .15s,transform .1s}
.pv-copy:hover{opacity:.86}
.pv-copy:active{transform:scale(.97)}
.pv-copy.copied{background:var(--accent);color:var(--on-accent,#04140c)}
.pv-note{margin:2px 0 8px;font-size:12.5px;color:var(--text-2)}

/* location rows: label left, value right */
.pv-info .pv-ico{background:none;width:24px;flex-basis:24px}
.pv-k2{flex:1;font-size:13.5px;color:var(--text-2)}
.pv-v{flex:0 1 auto;min-width:0;max-width:60%;text-align:right;font-size:13.5px;color:var(--text);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* bottom bar */
.pv-bar{display:grid;grid-template-columns:repeat(var(--n,3),minmax(0,1fr));margin-top:4px;
  background:var(--panel);border:1px solid var(--line);border-radius:14px;overflow:hidden}
.pv-tab{display:flex;flex-direction:column;align-items:center;gap:7px;padding:14px 6px 12px;
  background:none;border:0;border-left:1px solid var(--line-2);color:var(--text-2);font-size:12.5px;cursor:pointer;
  transition:background .15s,color .15s}
.pv-tab:first-child{border-left:0}
.pv-tab svg{width:20px;height:20px}
.pv-tab:hover{background:var(--panel-2);color:var(--text)}
.pv-tab[data-pv-report]:hover{color:var(--coral,#f0714f)}

/* report form */
.pv-reasons{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:12px 0 4px}
.pv-reasons label{display:flex;align-items:center;gap:8px;padding:9px 11px;border:1px solid var(--line);
  border-radius:10px;font-size:13px;cursor:pointer;color:var(--text-2)}
.pv-reasons input{accent-color:var(--accent)}
.pv-reasons label:has(input:checked){border-color:var(--accent);color:var(--text)}
.pv-rep-act{display:flex;justify-content:flex-end;gap:8px;padding:10px 0 4px}
.pv-rep-msg{margin:4px 0 6px;font-size:12.8px;color:var(--text-2);min-height:1px}
.pv-rep-msg.bad{color:var(--bad,#e07b7b)}
.pv-rep-msg.good{margin:10px 0;color:var(--accent)}

@media (max-width:640px){
  .pv-head{gap:12px}
  .pv-flag{width:48px;height:48px;flex-basis:48px}
  .pv-title b{font-size:15.5px}
  .pv-card{padding:4px 12px 6px}
  .pv-ico{width:30px;height:30px;flex-basis:30px}
  .pv-txt,.pv-k2,.pv-v{font-size:13px}
  .pv-copy{min-width:64px;padding:8px 12px}
  .pv-reasons{grid-template-columns:1fr}
}

/* inside a panel or a dialog: cards one step lighter/darker than it */
.panel .pv-card,.panel .pv-bar,.modal .pv-card,.modal .pv-bar{background:var(--panel-2)}
.panel .pv-ico,.modal .pv-ico{background:var(--panel-3)}
.panel .pv-info .pv-ico,.modal .pv-info .pv-ico{background:none}
.modal:has(.pv){width:min(480px,100%);max-height:calc(100vh - 32px);overflow-y:auto}
.modal .pv{margin-bottom:4px}
#doneView{margin:12px 0 4px}

/* ── report result ──────────────────────────────────────── */
.pv-rep{padding:14px 16px}
.pv-rep-row{display:flex;align-items:flex-start;gap:12px}
.pv-rep-row > span:last-child{min-width:0}
.pv-rep-row b{display:block;font-size:14px;margin-bottom:3px}
.pv-rep-row b + span{display:block;font-size:12.8px;line-height:1.55;color:var(--text-2)}
.pv-rep-ico{width:30px;height:30px;flex:0 0 30px;border-radius:50%;display:grid;place-items:center}
.pv-rep-ico svg{width:17px;height:17px}
.pv-rep.ok{border-color:color-mix(in srgb, var(--accent) 55%, var(--line))}
.pv-rep.ok .pv-rep-ico{background:color-mix(in srgb, var(--accent) 16%, transparent);color:var(--accent)}
.pv-rep.esc{border-color:color-mix(in srgb, var(--gold,#f5b721) 55%, var(--line))}
.pv-rep.esc .pv-rep-ico{background:color-mix(in srgb, var(--gold,#f5b721) 16%, transparent);color:var(--gold,#f5b721)}
.pv-rep.err .pv-rep-ico{background:var(--panel-3);color:var(--muted)}
.pv-spin{width:22px;height:22px;flex:0 0 22px;margin:4px;border-radius:50%;
  border:2.5px solid var(--line);border-top-color:var(--accent);animation:pvSpin .8s linear infinite}
@keyframes pvSpin{to{transform:rotate(360deg)}}

/* ── the popup (pages without their own dialog) ─────────── */
/* Sized and placed exactly like the Classic dialog (classic.css .overlay
   / .modal): centred, 440px wide, 20px from the screen edges. */
.pvm{position:fixed;inset:0;z-index:90;display:grid;place-items:center;padding:20px;
  background:rgba(8,11,15,.55);-webkit-backdrop-filter:blur(7px) saturate(.9);backdrop-filter:blur(7px) saturate(.9);
  opacity:0;pointer-events:none;transition:opacity .18s}
.pvm.open{opacity:1;pointer-events:auto}
html.pvm-lock{overflow:hidden}
/* min-width:0 matters: without it a long username (nowrap) makes the
   box as wide as the text, and it runs off the right of a phone */
.pvm-box{width:min(440px,100%);min-width:0;max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);
  display:flex;flex-direction:column;
  background:var(--panel);border:1px solid var(--line);border-radius:var(--r-lg,8px);overflow:hidden;
  transform:translateY(8px);transition:transform .18s;box-shadow:0 24px 60px -20px rgba(0,0,0,.6)}
.pvm.open .pvm-box{transform:none}
.pvm-head{display:flex;align-items:center;gap:10px;padding:13px 16px;border-bottom:1px solid var(--line)}
.pvm-head h3{margin:0;font-size:14.5px;font-weight:600}
.pvm-x{margin-left:auto;width:30px;height:30px;border-radius:8px;display:grid;place-items:center;
  background:none;border:0;color:var(--muted);cursor:pointer}
.pvm-x:hover{background:var(--panel-2);color:var(--text)}
.pvm-x svg{width:15px;height:15px}
.pvm-body{padding:16px;overflow-y:auto;min-width:0}
.pvm-body .pv,.pvm-body .pv-card,.pvm-body .pv-row{min-width:0}
.pvm-body .pv-card,.pvm-body .pv-bar{background:var(--panel-2)}
.pvm-body .pv-ico{background:var(--panel-3)}
.pvm-body .pv-info .pv-ico{background:none}

.pvm-back{display:inline-flex;align-items:center;gap:6px;margin:0 0 12px;padding:6px 10px 6px 6px;border-radius:8px;
  background:none;border:1px solid var(--line);color:var(--text-2);font-size:12.5px;cursor:pointer}
.pvm-back:hover{color:var(--text);border-color:var(--accent)}
.pvm-back svg{width:14px;height:14px}
.pvm-ok{display:flex;align-items:center;gap:7px;margin:0 0 12px;font-size:13px;color:var(--accent)}
.pvm-ok svg{width:15px;height:15px}

/* rows on the dialog itself, ruled between — no box around them */
.pvm-list{display:flex;flex-direction:column;margin:-6px -4px 0}
.pvm-row{display:flex;align-items:center;gap:12px;width:100%;padding:12px 6px;border-radius:0;text-align:left;cursor:pointer;
  background:none;border:0;border-top:1px solid var(--line-2);color:var(--text);transition:background .15s}
.pvm-row:first-child{border-top:0}
.pvm-row:hover:not(:disabled){background:var(--panel-2)}
.pvm-row.gone{opacity:.5;cursor:default}
.pvm-pager{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;padding-top:12px;border-top:1px solid var(--line-2)}
.pvm-pager span{font-family:var(--mono);font-size:12px;color:var(--muted)}
.pvm-pg{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;cursor:pointer;
  background:var(--panel-2);border:1px solid var(--line);color:var(--text)}
.pvm-pg svg{width:15px;height:15px}
.pvm-pg:hover:not(:disabled){border-color:var(--accent);color:var(--accent)}
.pvm-pg:disabled{opacity:.35;cursor:default}
.pvm-flag{width:34px;height:34px;flex:0 0 34px;border-radius:50%;overflow:hidden;background:var(--panel-3);box-shadow:0 0 0 1px var(--line)}
.pvm-flag img{width:100%;height:100%;object-fit:cover;display:block}
.pvm-t{flex:1;min-width:0}
.pvm-t b{display:block;font-size:13.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pvm-t span{display:block;margin-top:2px;font-family:var(--mono);font-size:11.5px;color:var(--muted);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pvm-arr{color:var(--muted);flex:0 0 auto}
.pvm-arr svg{width:14px;height:14px;display:block}
.pvm-row:hover .pvm-arr{color:var(--accent)}
.pvm-empty{padding:28px 14px;text-align:center;font-size:13px;color:var(--muted);line-height:1.6}
.pvm-empty b{display:block;color:var(--text-2);font-size:14px;margin-bottom:4px}
.pvm-empty .btn{margin-top:14px}
.pvm-foot{margin:12px 2px 0;font-size:12px;color:var(--muted)}
@media (max-width:640px){
  .pvm-body{padding:14px}
}


/* Premium: the data usage meter under the title */
.pv-meter{display:block;margin-top:6px;min-width:0}
.pv-meter .pv-mtext{display:block;font-size:12.8px;color:var(--text-2);margin:0}
.pv-meter .pv-mtext b{color:var(--text);font-weight:650}
.pv-meter .pv-mtext em{font-style:normal;color:var(--bad,#e07b7b)}
.pv-bar-t{display:block;height:7px;margin-top:6px;border-radius:99px;background:var(--panel-3);overflow:hidden;
  box-shadow:inset 0 0 0 1px var(--line)}
.pv-bar-t > i{display:block;height:100%;width:0;border-radius:99px;background:var(--accent);transition:width .5s ease}
.pv-meter.warm .pv-bar-t > i{background:var(--gold,#f5b721)}
.pv-meter.hot .pv-bar-t > i{background:var(--bad,#e07b7b)}
.pv-meter.loading .pv-bar-t > i{width:35%;opacity:.45;animation:pvMeter 1.1s ease-in-out infinite alternate}
@keyframes pvMeter{from{margin-left:0}to{margin-left:65%}}
@media (prefers-reduced-motion:reduce){ .pv-meter.loading .pv-bar-t > i{animation:none} }
.pv-head .pv-title{flex:1}
.pv-title .pv-meter .pv-mtext b{display:inline;font-size:inherit;letter-spacing:0;line-height:inherit;font-weight:650}
.pv-title .pv-meter .pv-mtext{margin-top:0;font-size:12.8px}
.pv-title .pv-meter .pv-mwhen{display:block;margin-top:5px;font-size:11.5px;color:var(--muted)}
.pv-mref{background:none;border:0;padding:0;font:inherit;color:var(--accent);cursor:pointer;text-decoration:underline;text-underline-offset:2px}
