/* Styles shared by the privacy tool pages (ISP, DNS leak, WebRTC leak, fingerprint) and news. */
.tool-card { max-width: 860px; margin-inline: auto; padding: clamp(20px, 4vw, 40px); border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--surface); }
.tool-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-block-start: 18px; }

/* verdict banner */
.verdict { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface-2); }
.verdict .ico { flex: 0 0 auto; }
.verdict h2 { font-size: clamp(19px, 2.2vw, 24px); margin-block-end: 4px; }
.verdict p { color: var(--muted); font-size: 14.5px; }
.verdict.ok { border-color: rgba(85, 255, 138, .35); background: var(--green-soft); }
.verdict.bad { border-color: rgba(232, 35, 47, .4); background: var(--red-soft); }
.verdict.warn { border-color: rgba(255, 239, 2, .3); background: rgba(255, 239, 2, .07); }
.verdict.ok .ico { color: var(--green-ink); }
.verdict.bad .ico { color: var(--red-2); }
:root.light .verdict.warn { background: rgba(200, 170, 0, .08); }

/* key/value grid */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-block-start: 20px; }
.kv div { padding: 14px; border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.kv span { display: block; color: var(--muted); font-size: 12.5px; margin-block-end: 2px; }
.kv b { display: block; font-family: var(--font-en); overflow-wrap: anywhere; }
.kv b.fa-txt { font-family: inherit; }
.kv .wide { grid-column: 1 / -1; }

/* progress */
.progress { height: 6px; border-radius: var(--pill); background: var(--surface-2); overflow: hidden; margin-block: 16px 6px; }
.progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--green-2), var(--green)); transition: width .35s var(--ease); }
.progress i.indet { animation: tool-indet 1.3s ease-in-out infinite; }
@keyframes tool-indet { from { transform: translateX(-110%); } to { transform: translateX(180%); } }
@media (prefers-reduced-motion: reduce) { .progress i.indet { animation: none; } }
.progress-label { color: var(--muted); font-size: 13.5px; text-align: center; }

/* tables inside tools */
.tool-table { margin-block-start: 20px; }
.tool-table td.mono, .tool-table td .mono { direction: ltr; unicode-bidi: isolate; }
.tool-table td .flag { width: 22px; height: 16px; vertical-align: -3px; margin-inline-end: 8px; }
.tool-table td.wrap { white-space: normal; overflow-wrap: anywhere; min-width: 140px; }

/* fingerprint list */
.fp-summary { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.fp-meter { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--fp-c, var(--green)) calc(var(--fp, 0) * 1%), var(--surface-2) 0); position: relative; }
.fp-meter::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface-solid); }
.fp-meter b { position: relative; font-size: 26px; font-family: var(--font-en); }
.fp-list { display: grid; gap: 8px; margin-block-start: 22px; }
.fp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); align-items: center; }
.fp-row .k { font-weight: 700; font-size: 14px; }
.fp-row .v { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); direction: ltr; text-align: start; overflow-wrap: anywhere; unicode-bidi: isolate; }
[dir='rtl'] .fp-row .v { text-align: right; }
.lvl { display: inline-flex; gap: 3px; align-items: center; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.lvl i { width: 6px; height: 12px; border-radius: 2px; background: var(--line-2); }
.lvl.l1 i:nth-child(-n+1) { background: var(--green); }
.lvl.l2 i:nth-child(-n+2) { background: var(--yellow); }
.lvl.l3 i:nth-child(-n+3) { background: var(--red-2); }
.lvl em { font-style: normal; margin-inline-start: 6px; }

/* news */
.news-list { display: grid; gap: 18px; max-width: 760px; margin-inline: auto; }
.news-card { border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.news-card img { width: 100%; max-height: 420px; object-fit: cover; display: block; background: var(--surface-2); }
.news-body { padding: clamp(16px, 3vw, 24px); }
.news-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--muted); font-size: 13px; margin-block-end: 10px; }
.news-meta .icon { width: 15px; height: 15px; vertical-align: -3px; }
.news-text { font-size: 15.5px; line-height: 1.9; overflow-wrap: anywhere; unicode-bidi: plaintext; text-align: start; }
.news-text a { color: var(--blue-ink); text-decoration: underline; text-underline-offset: 3px; }
.news-text pre { white-space: pre-wrap; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-family: var(--font-mono); font-size: 13px; direction: ltr; text-align: left; }
.news-text code { font-family: var(--font-mono); font-size: .9em; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); }
.news-foot { display: flex; justify-content: flex-end; margin-block-start: 14px; }
.news-skel { height: 160px; border-radius: var(--r-xl); }

@media (max-width: 600px) {
  .kv { grid-template-columns: 1fr; }
  .fp-summary { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .verdict { flex-direction: column; }
}
.tool-card .ip-big { text-align: center; font-size: clamp(22px, 4.6vw, 42px); }
@media (max-width: 600px) {
  .tool-table thead { display: none; }
  .tool-table table, .tool-table tbody, .tool-table tr, .tool-table td { display: block; }
  .tool-table tr { padding: 12px 14px; border-block-end: 1px solid var(--line); }
  .tool-table tr:last-child { border-block-end: 0; }
  .tool-table td { padding: 2px 0; border: 0; white-space: normal; overflow-wrap: anywhere; min-width: 0; color: var(--muted); font-size: 13.5px; }
  .tool-table td:first-child { color: var(--text); font-weight: 700; font-size: 14.5px; }
  [dir='rtl'] .tool-table td.mono { text-align: right; }
}

/* ---- network suite: ip-check, connectivity, speed test ---- */
.tool-card.wide { max-width: 1040px; }
.tool-nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-block-end: 22px; }
.tool-nav a, .chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13.5px; font-weight: 700; cursor: pointer; font-family: inherit; transition: .2s var(--ease); min-height: 36px; }
.tool-nav a:hover, .chip:hover { color: var(--text); border-color: var(--line-2); }
.chip[aria-pressed='true'] { background: var(--green-soft); color: var(--green-ink); border-color: rgba(85, 255, 138, .35); }
.net-sec { margin-block-start: clamp(40px, 6vw, 72px); scroll-margin-top: 90px; }
.net-head { max-width: 1040px; margin: 0 auto 18px; }
.net-head h2 { font-size: clamp(21px, 2.6vw, 28px); margin-block-end: 6px; }
.net-head p { font-size: 14.5px; }

.ipstacks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-block-start: 16px; }
.ipstack { padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.ipstack > span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-block-end: 4px; }
.ipstack b { display: block; font-size: clamp(14px, 1.9vw, 19px); direction: ltr; text-align: start; overflow-wrap: anywhere; unicode-bidi: isolate; }
[dir='rtl'] .ipstack b.mono { text-align: right; }
.ipstack b.dim { color: var(--subtle); font-weight: 500; font-size: 15px; direction: inherit; }
.ipstack em { font-style: normal; }

.src-grid { max-width: 1040px; margin-inline: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.src-card { padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.src-card.is-mobo { border-color: rgba(85, 255, 138, .35); background: var(--green-soft); }
.src-card.fail { opacity: .8; }
.src-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.src-top h3 { font-size: 16px; }
.src-top .muted { font-size: 12.5px; }
.src-ip { font-size: clamp(15px, 2vw, 19px); font-weight: 700; direction: ltr; text-align: start; overflow-wrap: anywhere; unicode-bidi: isolate; }
[dir='rtl'] .src-ip { text-align: right; }
.src-card > .badge { align-self: flex-start; }
.src-kv { display: grid; gap: 6px; }
.src-kv > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.src-kv span { color: var(--muted); flex: 0 0 auto; }
.src-kv b { font-weight: 600; text-align: end; min-width: 0; overflow-wrap: anywhere; }
.src-kv b.mono { direction: ltr; unicode-bidi: isolate; font-size: 12.5px; }
.src-kv .flag { width: 20px; height: 14px; vertical-align: -2px; margin-inline-end: 6px; }
.src-empty { font-size: 13.5px; }
.skeleton.line { height: 46px; border-radius: var(--r); }
a.tool-link { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
a.tool-link .go { margin-block-start: auto; color: var(--green-ink); font-weight: 700; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
[dir='rtl'] a.tool-link .go .icon { transform: scaleX(-1); }

/* connectivity */
.conn-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-block-end: 18px; }
.conn-toolbar .group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.conn-cat { margin-block-start: 28px; }
.conn-cat-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-block-end: 12px; }
.conn-cat-head h2 { font-size: 19px; }
.conn-cat-head .badge { margin-inline-start: 0; }
.conn-cat-head .spacer { flex: 1; }
.conn-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--green-soft); border: 1px solid rgba(85, 255, 138, .3); font-size: 14px; margin-block-end: 12px; }
.conn-note.off { background: var(--surface-2); border-color: var(--line); }
.conn-note.off .icon { color: var(--muted); }
.conn-note .icon { flex: 0 0 auto; color: var(--green-ink); margin-block-start: 2px; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 10px; }
.site-tile { position: relative; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 4px; min-width: 0; text-align: start; font: inherit; color: inherit; cursor: pointer; transition: border-color .2s var(--ease), background .2s var(--ease); }
.site-tile:hover { border-color: var(--line-2); }
@keyframes tool-blink { 50% { opacity: .25; } }
.site-tile .x { position: absolute; top: 8px; inset-inline-end: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--subtle); border: 0; background: transparent; cursor: pointer; padding: 0; opacity: 0; transition: .15s; }
.site-tile:hover .x, .site-tile:focus-within .x { opacity: 1; }
.site-tile .x:hover { color: var(--bad); background: var(--surface-2); }
.site-tile .x .icon { width: 13px; height: 13px; }
@media (hover: none) { .site-tile .x { opacity: .7; } }
.conn-sum { display: flex; flex-wrap: wrap; gap: 8px; }
.add-form { display: grid; grid-template-columns: 1fr 1.6fr auto auto; gap: 8px; align-items: center; margin-block-start: 14px; }
.add-form[hidden], .conn-io[hidden] { display: none; }
.field { width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; min-width: 0; }
.field:focus { outline: 2px solid var(--blue-ink); outline-offset: 1px; }
textarea.field { min-height: 110px; font-family: var(--font-mono); font-size: 12.5px; direction: ltr; resize: vertical; }
.conn-io { margin-block-start: 14px; display: grid; gap: 8px; }
.conn-msg { font-size: 13.5px; color: var(--muted); margin-block-start: 8px; }
.conn-msg.err { color: var(--red-2); }

/* speed test */
.speed-wrap { display: grid; justify-items: center; gap: 18px; }
.gauge { width: min(100%, 420px); position: relative; }
.gauge svg { width: 100%; height: auto; display: block; direction: ltr; }
.gauge .trk { fill: none; stroke: var(--surface-2); stroke-width: 16; stroke-linecap: round; }
.gauge .val { fill: none; stroke: url(#gaugeGrad); stroke-width: 16; stroke-linecap: round; }
.gauge .tick { fill: var(--subtle); font-size: 11px; font-family: var(--font-en); }
.gauge .needle { stroke: var(--text); stroke-width: 3; stroke-linecap: round; transform-origin: 150px 150px; }
.gauge .hub { fill: var(--text); }
.gauge-read { text-align: center; margin-block-start: 6px; }
.gauge-read b { display: block; font-family: var(--font-en); font-size: clamp(34px, 9vw, 52px); line-height: 1; }
.gauge-read span { color: var(--muted); font-size: 13.5px; font-family: var(--font-en); }
.gauge-phase { color: var(--muted); font-size: 14px; min-height: 22px; text-align: center; }
.speed-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%; }
.speed-stat { padding: 14px; border-radius: var(--r); background: var(--surface-2); text-align: center; border: 1px solid transparent; min-width: 0; }
.speed-stat.on { border-color: rgba(85, 255, 138, .4); }
.speed-stat span { display: block; color: var(--muted); font-size: 12.5px; }
.speed-stat b { display: block; font-family: var(--font-en); font-size: clamp(18px, 3vw, 26px); direction: ltr; }
.speed-stat small { color: var(--subtle); font-family: var(--font-en); font-size: 12px; }
.speed-opts { display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: center; align-items: center; color: var(--muted); font-size: 13.5px; }
.speed-opts label { display: inline-flex; gap: 8px; align-items: center; }
.speed-opts .field { width: auto; min-height: 36px; padding: 4px 10px; }

@media (max-width: 700px) {
  .ipstacks { grid-template-columns: 1fr; }
  .add-form { grid-template-columns: 1fr 1fr; }
  .add-form .field { grid-column: 1 / -1; }
  .speed-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conn-toolbar { flex-direction: column; align-items: stretch; }
  .conn-toolbar .group { justify-content: center; }
}

.net-checks { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: 14px; }
.net-checks li { display: flex; gap: 8px; align-items: flex-start; }
.net-checks .icon { color: var(--green-ink); flex: 0 0 auto; margin-block-start: 3px; }
.net-checks a { color: var(--blue-ink); text-decoration: underline; text-underline-offset: 3px; }

/* connectivity tiles: avatar, status face + latest ms, history bars */
.site-tile { gap: 9px; }
.site-tile .top { display: flex; gap: 9px; align-items: center; min-width: 0; padding-inline-end: 20px; }
.site-tile .av { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-family: var(--font-en); font-size: 13px; flex: 0 0 auto; }
.site-tile .nm { font-weight: 700; font-size: 14.5px; padding: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-tile .sstat { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; }
.site-tile .stt { display: inline-flex; gap: 5px; align-items: center; font-weight: 700; color: var(--muted); }
.site-tile .face { width: 17px; height: 17px; flex: 0 0 auto; }
.site-tile .ms { font-family: var(--font-en); color: var(--muted); direction: ltr; }
.site-tile[data-s='ok'] .stt { color: var(--green-ink); }
.site-tile[data-s='slow'] .stt { color: var(--yellow); }
.site-tile[data-s='fail'] { border-color: rgba(232, 35, 47, .4); background: var(--red-soft); }
.site-tile[data-s='fail'] .stt { color: var(--bad); }
.site-tile[data-s='load'] .face { animation: tool-blink 1s ease-in-out infinite; }
/* history: one small bar per probe, oldest on the left; taller and warmer = slower */
.site-tile .bars { display: flex; align-items: flex-end; gap: 5px; height: 16px; direction: ltr; }
.site-tile .bars i { width: 5px; height: 4px; border-radius: 2px; background: transparent; }
.site-tile .bars i.g { background: var(--green-2); height: 5px; }
.site-tile .bars i.y { background: var(--yellow); height: 10px; }
.site-tile .bars i.r { background: #ff5a4d; height: 16px; }
.site-tile .bars i.p { background: var(--muted, #8a8f98); opacity: .45; height: 4px; }
.site-tile .bars i.n { background: #ff5a4d; opacity: .7; height: 4px; }
.site-tile .av { position: relative; overflow: hidden; }
.site-tile .av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 3px; background: #fff; border-radius: inherit; opacity: 0; }
.site-tile .av.has-img img { opacity: 1; }

/* dropdowns: opaque background so the native list is readable in both themes */
select.field { background-color: var(--surface-solid); color: var(--text); color-scheme: dark; cursor: pointer; }
:root.light select.field { color-scheme: light; }
select.field option { background-color: var(--surface-solid); color: var(--text); }

/* shareable speed result */
.share-wrap { width: 100%; max-width: 640px; }
.share-wrap h3 { font-size: 17px; margin-block-end: 10px; text-align: center; }
.share-card { max-width: 640px; margin-inline: auto; padding: clamp(16px, 3vw, 26px); border-radius: var(--r-xl); border: 1px solid var(--line-2); background: linear-gradient(135deg, var(--surface-solid), var(--bg-2)); box-shadow: var(--shadow); }
.sc-brand { display: flex; align-items: center; gap: 10px; margin-block-end: 16px; }
.sc-brand img { border-radius: 8px; }
.sc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sc-grid > div { padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.sc-grid span { display: block; color: var(--muted); font-size: 12.5px; }
.sc-grid b { font-family: var(--font-en); font-size: clamp(24px, 6vw, 34px); direction: ltr; display: inline-block; }
.sc-grid > div:nth-child(-n+2) b { color: var(--green-ink); }
.sc-grid small { color: var(--muted); font-family: var(--font-en); margin-inline-start: 6px; }
.sc-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-block-start: 14px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

.src-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.src-badges .badge .icon { width: 13px; height: 13px; }

.score-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-block-start: 16px; }
.score-part { padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.score-part span { color: var(--muted); font-size: 12.5px; display: block; }
.score-part b { font-family: var(--font-en); font-size: 22px; }
.score-part small { color: var(--muted); font-size: 13px; }
.score-part .progress { margin-block: 6px 0; }
@media (max-width: 480px) { .score-parts { grid-template-columns: 1fr; } }
