@font-face{
  font-family:'Vazir';
  src:url('/static/fonts/Vazir.woff') format('woff');
  font-weight:400;
  font-style:normal;
}

/* =========================
   Theme Tokens
========================= */
:root{
  --bg:#0a1128;
  --bg-2:#101c3a;

  --panel:#0f172a;
  --panel-2:#111c34;

  --surface:rgba(15,23,42,0.76);
  --surface-strong:rgba(15,23,42,0.92);
  --surface-soft:rgba(255,255,255,0.04);

  --card-grad:linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025));
  --border:rgba(148,163,184,0.18);
  --border-soft:rgba(148,163,184,0.10);

  --muted:#94a3b8;
  --text:#f8fafc;

  --accent:#3b82f6;
  --accent-2:#60a5fa;

  --success:#22c55e;
  --warning:#f59e0b;
  --danger:#ef4444;

  --radius:18px;
  --radius-lg:21px;
  --gap:16px;

  --shadow-sm:0 5px 16px rgba(0,0,0,0.16);
  --shadow-md:0 12px 30px rgba(0,0,0,0.26);
  --shadow-lg:0 20px 53px rgba(0,0,0,0.38);
  --shadow-xl:0 25px 71px rgba(2,6,23,0.42);

  font-family:"Vazir", system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  font-size:12px;
  color-scheme:dark;
}

:root[data-theme="light"]{
  --bg:#edf2f7;
  --bg-2:#dde6f1;

  --panel:#ffffff;
  --panel-2:#eef4fb;

  --surface:rgba(255,255,255,0.80);
  --surface-strong:rgba(255,255,255,0.94);
  --surface-soft:rgba(37, 99, 235,0.04);

  --card-grad:linear-gradient(180deg, rgba(255,255,255,0.98), rgba(243,247,252,0.98));
  --border:rgba(15,23,42,0.14);
  --border-soft:rgba(15,23,42,0.10);

  --muted:#526277;
  --text:#0f172a;

  --accent:#1d4ed8;
  --accent-2:#2563eb;

  --success:#16a34a;
  --warning:#d97706;
  --danger:#dc2626;

  --shadow-sm:0 7px 16px rgba(15,23,42,0.07);
  --shadow-md:0 12px 30px rgba(15,23,42,0.09);
  --shadow-lg:0 21px 53px rgba(15,23,42,0.12);
  --shadow-xl:0 27px 71px rgba(15,23,42,0.14);

  color-scheme:light;
}

/* =========================
   Base
========================= */
*{ box-sizing:border-box; }

html, body{
  height:100%;
  margin:0;
}

html{
  scroll-behavior:smooth;
}

html::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-2;
  background:
    radial-gradient(circle at 85% 10%, rgba(59, 130, 246,0.16), transparent 34%),
    radial-gradient(circle at 12% 18%, rgba(96, 165, 250,0.10), transparent 26%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

body{
  color:var(--text);
  overflow-x:hidden;
  background:transparent;
}

:root[data-theme="light"] body{
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235,0.10), transparent 24%),
    radial-gradient(circle at top left, rgba(29, 78, 216,0.08), transparent 20%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

a{
  color:inherit;
  text-decoration:none;
}

img{
  max-width:100%;
  display:block;
}

button,
input,
select,
textarea{
  font:inherit;
}

.kv{
  color:var(--muted);
  font-size:12px;
  line-height:1.7;
}

.small{
  font-size:11px;
  color:var(--muted);
}

:focus-visible{
  outline:1.78px solid rgba(59, 130, 246,0.55);
  outline-offset:2.67px;
  border-radius:11px;
}

/* =========================
   Layout
========================= */
.app{
  display:grid;
  grid-template-columns: 267px minmax(0, 1fr);
  gap:16px;
  min-height:100vh;
  padding:16px;
  overflow:visible !important;
}

.grid{
  display:grid;
  grid-template-columns:repeat(12, minmax(0, 1fr));
  gap:var(--gap);
}

.col-12{ grid-column:span 12; }
.col-9{ grid-column:span 9; }
.col-4{ grid-column:span 4; }
.col-3{ grid-column:span 3; }

.overlay{
  position:fixed;
  inset:0;
  background:rgba(2,6,23,0.58);
  opacity:0;
  pointer-events:none;
  transition:opacity .22s ease;
  z-index:1990;
}


/* =========================
   Device Switch (Mobile/Desktop tabs)
========================= */
.device-switch-card{
  padding:9px;
}

.device-switch{
  display:flex;
  gap:9px;
}

.device-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
  padding: 7px 12px 7px 9px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.01);
  font-family: inherit;
  text-align: right;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, opacity .18s ease, box-shadow .18s ease;
}

.device-tab-icon{
  width:39px;
  height:39px;
  flex-shrink:0;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,0.05);
  color:var(--muted);
  transition:background .18s ease, color .18s ease;
}

.device-tab-icon svg{
  width:20px;
  height:20px;
}

.device-tab-text {
  display: flex;
  flex-direction: column;
  gap: 1.78px;
  flex: 1;
  min-width: 0;
}

.device-tab-title{
  font-size:13px;
  font-weight:800;
  color:var(--text);
  line-height:1.2;
}

.device-tab-sub{
  font-size:10px;
  font-weight:600;
  color:var(--muted);
  letter-spacing:.02em;
}

.device-tab-score {
  min-width: 32px;
  height: 32px;
  padding: 0 3.56px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  flex-shrink: 0;
}

.device-tab:hover:not(:disabled){
  background: rgba(37, 99, 235, 0.16);
  color: var(--text);
  border-color: rgba(37, 99, 235, 0.24);
}

:root[data-theme="light"] .device-tab.active {
  background: linear-gradient(90deg, rgba(29, 78, 216, 0.16), rgba(37, 99, 235, 0.10));
  border-color: rgba(29, 78, 216, 0.24)
}

:root[data-theme="light"] .device-tab-score {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(15, 23, 42, 0.03);
}

.device-tab.active {
  background: linear-gradient(90deg, rgba(29, 78, 216, 0.16), rgba(37, 99, 235, 0.10));
  border-color: rgba(29, 78, 216, 0.24)
}

.device-tab.active .device-tab-icon{
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#fff;
}

.device-tab:disabled{
  opacity:.4;
  cursor:not-allowed;
}

/* =========================
   Cards
========================= */

.card:hover{
  transform:translateY(-2px);
  border-color:rgba(59, 130, 246,0.18);
  box-shadow:
    var(--shadow-lg),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

:root[data-theme="light"] .card{
  background:linear-gradient(180deg, rgba(255,255,255,0.98), rgba(242,247,252,0.98));
  border:1px solid rgba(15,23,42,0.12);
  box-shadow:
    0 11px 25px rgba(15,23,42,0.08),
    0 2.67px 9px rgba(15,23,42,0.05),
    inset 0 1px 0 rgba(255,255,255,0.95);
}

:root[data-theme="light"] .card:hover{
  border-color:rgba(37, 99, 235,0.20);
  box-shadow:
    0 16px 36px rgba(37, 99, 235,0.10),
    0 5px 14px rgba(15,23,42,0.06),
    inset 0 1px 0 rgba(255,255,255,0.98);
}


.meta{
  min-width:0;
  display:flex;
  align-items:center;
  gap:9px;
}

#metaUrl{
  max-width:22vw;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.row{
  display:flex;
  gap:11px;
  align-items:center;
  flex-wrap:wrap;
}

.topbar-main-row{
  direction:ltr;
  justify-content:flex-start;
  align-content:flex-start;
}

/* =========================
   Topbar Mini Gauges
========================= */
.topbar-scores-inline{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  flex-wrap:nowrap;
  white-space:nowrap;
  opacity:0;
  transform:translateY(-6px);
  pointer-events:none;
  max-height:0;
  overflow:hidden;
  transition:opacity .18s ease, transform .18s ease, max-height .18s ease;
}

body.scrolled .topbar-scores-inline{
  opacity:1;
  transform:translateY(0);
  pointer-events:auto;
  max-height:64px;
}

/* از این عرض به بعد فضای کافی برای وسط‌چین دقیق نسبت به کل topbar وجود داره */
@media (min-width: 1181px){
  .topbar-scores-inline{
    position:absolute;
    left:50%;
    top:50%;
    transform:translate(-50%, -6px);
    z-index:2;
  }

  body.scrolled .topbar-scores-inline{
    transform:translate(-50%, -50%);
  }
}

.mini-g{
  width:43px;
  text-align:center;
  flex:0 0 auto;
}

.mini-g .gauge{
  width:43px;
  height:43px;
  margin:0 auto;
}

.mini-g .gauge .label .num{
  font-size:12px;
}

.mini-g .gauge .label .sub{
  display:none;
}

/* =========================
   Theme Toggle / Hamburger
========================= */
.theme-toggle{
  width:100%;
  display:inline-flex;
  align-items:center;
  justify-content:space-between;
  gap:9px;
  min-height:46px;
  padding:0 11px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.03);
  cursor:pointer;
  user-select:none;
  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease,
    transform .18s ease;
}

.theme-toggle:hover{
  border-color:rgba(59, 130, 246,0.42);
  box-shadow:0 0 0 2.67px rgba(59, 130, 246,0.10);
  transform:translateY(-1px);
}

.theme-toggle .label{
  font-weight:900;
  font-size:11px;
  display:flex;
  align-items:center;
  gap:7px;
  opacity:.95;
}

.theme-toggle .pill{
  width:41px;
  height:23px;
  border-radius:999px;
  background:rgba(255,255,255,0.10);
  position:relative;
  border:1px solid var(--border);
  flex:0 0 auto;
}

.theme-toggle .dot{
  width:18px;
  height:18px;
  border-radius:999px;
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  right:2.67px;
  background:linear-gradient(90deg, var(--accent), var(--accent-2));
  transition:right .2s ease, left .2s ease, background .2s ease;
}

:root[data-theme="light"] .theme-toggle{
  background:rgba(255,255,255,0.82);
  border-color:rgba(15,23,42,0.10);
  box-shadow:0 5px 14px rgba(15,23,42,0.06), inset 0 1px 0 rgba(255,255,255,0.92);
}

:root[data-theme="light"] .theme-toggle:hover{
  border-color:rgba(37, 99, 235,0.22);
  box-shadow:0 9px 18px rgba(37, 99, 235,0.10), 0 0 0 2.67px rgba(37, 99, 235,0.08);
}

:root[data-theme="light"] .theme-toggle .label{
  color:#334155;
}

:root[data-theme="light"] .theme-toggle .pill{
  background:rgba(0,0,0,0.06);
}

:root[data-theme="light"] .theme-toggle .dot{
  right:auto;
  left:2.67px;
  background:linear-gradient(90deg, #ffb020, #ffd36a);
}

.hamburger{
  display:none;
  width:39px;
  height:39px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.04);
  cursor:pointer;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:4px;
  transition:transform .18s ease, border-color .18s ease, background .18s ease;
}

.hamburger:hover{
  transform:translateY(-1px);
  border-color:rgba(59, 130, 246,0.30);
}

.hamburger span{
  display:block;
  width:18px;
  height:1.78px;
  background:var(--text);
  border-radius:1.78px;
}

/* =========================
   Legend
========================= */
.legend{
  display:flex;
  gap:9px;
  align-items:center;
  flex-wrap:wrap;
}

.legend .item{
  display:flex;
  gap:5px;
  align-items:center;
  color:var(--muted);
  font-size:12px;
}

/* =========================
   Gauges
========================= */
.overview-left{
  display:flex;
  flex-direction:column;
}

.overview-left .gauges{
  margin-top:auto;
  margin-bottom:auto;
}

.gauges{
  padding-left:13px;
  padding-right:13px;
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(107px, 1fr));
  gap:14px;
  width:100%;
  justify-items:center;
}

.gauge{
  width:100%;
  height:auto;
  aspect-ratio:1/1;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
}

.gauge svg{
  transform:rotate(-90deg);
  width:100%;
  height:100%;
}

.gauge .label{
  position:absolute;
  text-align:center;
  font-weight:900;
}

.gauge .label .num{
  font-size:18px;
}

.gauge .label .sub{
  font-size:10px;
  color:var(--muted);
}

/* =========================
   Overview
========================= */
#overviewCard{
  padding:14px;
}

#totalBytes{
  direction:ltr;
  text-align:left;
  unicode-bidi:embed;
}

.overview-gauge-head,
.overview-summery-resources,
.overview-shot-head,
.vitals-filmstrip-head,
.card-head{
  padding-bottom:9px;
  margin-bottom:11px;
  border-bottom:1px solid var(--border);
}

.section-title{
  font-weight:700;
  font-size:13px;
}

.overview-grid{
  display:grid;
  grid-template-columns:minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap:var(--gap);
}

.overview-shot-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:9px;
}

.final-shot{
  width:100%;
  max-height:196px;
  border-radius:16px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.02);
  overflow:hidden;
  display:grid;
  place-items:center;
  aspect-ratio:9/16;
  box-shadow:0 16px 44px rgba(0,0,0,0.30);
}

.final-shot.mobile-view {
  max-height: 258px !important;
  aspect-ratio: auto !important;
  height: 258px !important;
  padding: 0 !important;
}

.final-shot.mobile-view img {
  width: auto !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

:root[data-theme="light"] .final-shot{
  background:linear-gradient(180deg, rgba(248,250,252,0.98), rgba(234,241,248,0.98));
  border:1px solid rgba(15,23,42,0.12);
  box-shadow:
    0 16px 36px rgba(15,23,42,0.12),
    inset 0 1px 0 rgba(255,255,255,0.96);
}

.final-shot img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:none;
}

.final-shot .empty{
  padding:12px;
  color:var(--muted);
  text-align:center;
}

/* =========================
   Audit Cards / Lists
========================= */
.audit-card{
  display:flex;
  flex-direction:column;
  min-height:231px;
}

/* =========================
   Network Waterfall
========================= */
.waterfall-legend{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  margin-top:10px;
  margin-bottom:12px;
}

.wf-legend-item{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:11.5px;
  color:var(--muted);
}

.wf-dot{
  width:10px;
  height:10px;
  border-radius:3px;
  display:inline-block;
  flex-shrink:0;
}

.waterfall-scroll{
  direction:ltr;
  margin:0;
  max-height:480px;
  overflow-y:auto;
  overflow-x:auto;
  border:1px solid var(--border-soft);
  border-radius:14px;

  background:rgba(255,255,255,0.015);
}

.waterfall-timeline{
  position:relative;
  margin:0;
  min-width:600px;
  --wf-inset-start:222px;
  --wf-inset-end:80px;
}

.waterfall-ruler{
  position:sticky;
  top:0;
  z-index:3;
  height:26px;
  padding:6px 0px;
  margin:0;
  border-bottom:1px solid var(--border-soft);
  background:var(--card-grad), var(--bg);
}

.waterfall-rows {
  padding:0px 12px 8px 12px;
}

.wf-ruler-track{
  position:relative;
  height:100%;
  margin-inline-start:var(--wf-inset-start);
  margin-inline-end:var(--wf-inset-end);
}

.waterfall-gridlines{
  position:absolute;
  top:0;
  bottom:0;
  left:var(--wf-inset-start);
  right:var(--wf-inset-end);
  pointer-events:none;
  z-index:1;
}

.wf-gridline{
  position:absolute;
  top:0;
  bottom:0;
  width:1px;
  background:var(--border-soft);
  opacity:.6;
}

.wf-tick{
  position:absolute;
  top:0;
  transform:translateX(-50%);
  font-size:10px;
  color:var(--muted);
  white-space:nowrap;
}

.wf-tick:first-child{
  transform:none;
}

.wf-ruler-marker{
  position:absolute;
  top:0;
  transform:translateX(-50%);
  font-size:10px;
  font-weight:800;
  white-space:nowrap;
}

.wf-row{
  display:flex;
  align-items:center;
  gap:10px;
  height:25px;
}

.wf-label{
  width:200px;
  flex-shrink:0;
  display:flex;
  align-items:center;
  gap:6px;
  overflow:hidden;
}

.wf-row-dot{
  width:8px;
  height:8px;
  border-radius:2px;
  flex-shrink:0;
}

.wf-row-name{
  font-size:11.5px;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.wf-track{
  position:relative;
  flex:1;
  min-width:0;
  height:14px;
  border-radius:4px;
  background:rgba(255,255,255,0.02);
}

.wf-track::before,
.wf-track::after{
  content:"";
  position:absolute;
  top:-5px;
  bottom:-5px;
  width:1px;
  pointer-events:none;
}

.wf-track::before{
  left:var(--fcp-pct, -10%);
  background:var(--warning);
  opacity:.35;
}

.wf-track::after{
  left:var(--lcp-pct, -10%);
  background:var(--accent);
  opacity:.45;
}

.wf-bar{
  position:absolute;
  top:1px;
  bottom:1px;
  border-radius:3px;
  min-width:2px;
  cursor:pointer;
}

.wf-meta{
  width:58px;
  flex-shrink:0;
  font-size:11px;
  color:var(--muted);
}

.waterfall-note{
  margin-top:10px;
  font-size:12px;
  color:var(--muted);
}

.card-title{
  font-weight:900;
  font-size:15px;
}

.card-sub{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}

.card-body{
  flex:1;
  overflow:auto;
}

.audit-list{
  margin-top:8px;
  background:rgba(255,255,255,0.02);
  border-radius:14px;
  padding:10px;
  border:1px solid var(--border-soft);
  max-height:520px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.audit{
  padding:12px;
  border-radius:14px;
  background:rgba(255,255,255,0.02);
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  border:1px solid transparent;
  transition:transform .16s ease, border-color .16s ease, background .16s ease;
}

.audit:hover{
  transform:translateY(-1px);
  border-color:var(--border);
  background:rgba(255,255,255,0.03);
}

.audit .left{
  flex:1;
  min-width:0;
}

.audit .title{
  font-weight:900;
  margin-bottom:4px;
}

.audit .kv{
  color:var(--muted);
  font-size:13px;
  overflow:hidden;
  text-overflow:ellipsis;
}

.badge{
  padding:6px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
  white-space:nowrap;
}

:root[data-theme="light"] .audit-list,
:root[data-theme="light"] .filmstrip,
:root[data-theme="light"] .acc,
:root[data-theme="light"] .simple-item,
:root[data-theme="light"] .info-box,
:root[data-theme="light"] .metric-card,
:root[data-theme="light"] .feature-item,
:root[data-theme="light"] .step{
  background:rgba(244,248,253,0.88);
  border-color:rgba(15,23,42,0.09);
}

:root[data-theme="light"] .audit,
:root[data-theme="light"] .acc-summary,
:root[data-theme="light"] .chip,
:root[data-theme="light"] .pill,
:root[data-theme="light"] .chev{
  background:rgba(248,250,252,0.80);
  border-color:rgba(15,23,42,0.07);
}

:root[data-theme="light"] .audit:hover,
:root[data-theme="light"] .acc-summary:hover{
  background:rgba(37, 99, 235,0.05);
  border-color:rgba(37, 99, 235,0.12);
}

:root[data-theme="light"] .cat-section,
:root[data-theme="light"] .hero-card,
:root[data-theme="light"] .author-card{
  background:linear-gradient(180deg, rgba(255,255,255,0.96), rgba(243,247,253,0.98));
  border:1px solid rgba(15,23,42,0.10);
}

/* =========================
   Filmstrip
========================= */
.filmstrip{
  display:flex;
  gap:18px;
  overflow-x:auto;
  overflow-y:hidden;
  padding:9px 5px;
  background:rgba(255,255,255,0.02);
  border-radius:var(--radius);
  border:1px solid var(--border-soft);
}

.thumb-wrap{
  text-align:center;
  flex:0 0 auto;
}

.thumb{
  width:120px;
  height:80px;
  border-radius:9px;
  background-size:cover;
  background-position:top;
  border:1px solid var(--border-soft);
}

.thumb.mobile-view {
  height: 196px;
  width:89px;
}

.thumb-time{
  margin-top:5px;
  font-size:11px;
  color:var(--muted);
}

/* =========================
   Categories
========================= */
#categoriesSections > .cat-section + .cat-section{
  margin-top:20px;
}

.cat-section{
  border:1px solid var(--border-soft);
  border-radius:16px;
  padding:14px;
  background:rgba(255,255,255,0.012);
}

.cat-hero{
  text-align:center;
  padding:16px 11px;
  border-bottom:1px solid var(--border);
  margin-bottom:12px;
}

.cat-name{
  font-size:25px;
  font-weight:900;
  letter-spacing:-0.36px;
  margin-bottom:9px;
}

.cat-score-gauge{
  width:116px;
  margin:0 auto;
}

.cat-score-caption{
  margin-top:7px;
  font-size:11px;
  color:var(--muted);
}

.cat-desc{
  margin-top:12px;
  line-height:1.95;
  color:rgba(255,255,255,0.78);
  background:rgba(255,255,255,0.02);
  border:1px solid var(--border-soft);
  padding:11px;
  border-radius:12px;
}

:root[data-theme="light"] .cat-desc{
  background:linear-gradient(180deg, rgba(246,249,253,1), rgba(237,243,249,1));
  border:1px solid rgba(15,23,42,0.11);
  color:#334155;
}

.cat-desc a{
  color:var(--accent-2);
  font-weight:900;
  text-decoration:none;
  border-bottom:1px dashed rgba(59, 130, 246,0.45);
  overflow-wrap:anywhere;
  word-break:break-word;
  direction:ltr;
  unicode-bidi:plaintext;
}

.cat-desc a:hover{
  border-bottom-style:solid;
}

:root[data-theme="light"] .cat-desc a{
  color:#4338ca;
  border-bottom-color:rgba(23, 58, 115,0.35);
}

/* =========================
   Accordion
========================= */
.acc{
  margin-top:14px;
  border-radius:14px;
  border:1px solid var(--border-soft);
  overflow:hidden;
  background:rgba(255,255,255,0.02);
}

.acc + .acc{
  margin-top:11px;
}

.acc-summary{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:9px;
  padding:11px;
  cursor:pointer;
  user-select:none;
  border:0;
  background:transparent;
  color:var(--text);
  font-family:inherit;
}

.acc-summary:hover{
  background:rgba(255,255,255,0.03);
}

.acc-left{
  display:flex;
  align-items:center;
  gap:9px;
  min-width:0;
}

.acc-title{
  font-weight:900;
  white-space:nowrap;
}

.acc-sub{
  font-size:11px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:46vw;
}

.acc-right{
  display:flex;
  align-items:center;
  gap:9px;
  flex:0 0 auto;
}

.pill{
  font-size:11px;
  font-weight:900;
  color:var(--muted);
  border:1px solid var(--border-soft);
  background:rgba(255,255,255,0.02);
  padding:3.56px 9px;
  border-radius:999px;
}

.bad{
  font-size:11px;
  font-weight:900;
  border-radius:999px;
  padding:4px 9px;
  border:1px solid transparent;
  white-space:nowrap;
}

.bad.fix{
  color:#1a1100;
  background:rgba(255,176,32,0.95);
  border-color:rgba(255,176,32,0.55);
}

.bad.info{
  color:#06121a;
  background:rgba(154,168,192,0.75);
  border-color:rgba(154,168,192,0.35);
}

.bad.ok{
  color:#06121a;
  background:rgba(46,204,113,0.92);
  border-color:rgba(46,204,113,0.50);
}

.bad.insight{
  color:#06121a;
  background:rgba(59, 130, 246,0.85);
  border-color:rgba(59, 130, 246,0.50);
}

:root[data-theme="light"] .bad.info{
  color:#06121a;
  background:rgba(11,18,32,0.12);
  border-color:rgba(11,18,32,0.10);
}

.chev{
  width:30px;
  height:30px;
  border-radius:11px;
  display:grid;
  place-items:center;
  border:1px solid var(--border-soft);
  background:rgba(255,255,255,0.02);
  transition:transform .18s ease;
}

.acc[data-open="1"] .chev{
  transform:rotate(180deg);
}

.acc-body{
  display:none;
  padding:11px;
  border-top:1px solid var(--border-soft);
}

.acc[data-open="1"] .acc-body{
  display:block;
}

.acc-hint{
  margin-bottom:9px;
  font-size:11px;
  color:var(--muted);
}

/* =========================
   Simple Lists
========================= */
.simple-list{
  display:flex;
  flex-direction:column;
  gap:9px;
}

.simple-item{
  border:1px solid var(--border-soft);
  background:rgba(255,255,255,0.02);
  border-radius:12px;
  padding:9px;
}

.simple-item.fix{
  border-color:rgba(255,176,32,0.45);
  background:rgba(255,176,32,0.08);
}

.simple-item.ok{
  border-color:rgba(46,204,113,0.35);
  background:rgba(46,204,113,0.06);
}

.simple-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:11px;
}

.simple-title{
  font-weight:900;
  line-height:1.6;
}

.simple-meta{
  font-size:11px;
  color:var(--muted);
  white-space:nowrap;
}

.simple-desc{
  margin-top:5px;
  color:var(--muted);
  line-height:1.85;
}

.simple-desc a{
  color:var(--accent-2);
  font-weight:900;
  text-decoration:none;
  border-bottom:1px dashed rgba(59, 130, 246,0.45);
}

.simple-desc a:hover{
  border-bottom-style:solid;
}

:root[data-theme="light"] .simple-desc a{
  color:#4338ca;
  border-bottom-color:rgba(23, 58, 115,0.35);
}

/* =========================
   Insights UI
========================= */
.insight-thumb{
  margin-top:9px;
  border-radius:12px;
  overflow:hidden;
  border:1px solid var(--border-soft);
  background:rgba(255,255,255,0.02);
}

.insight-thumb img{
  width:100%;
  height:auto;
  display:block;
}

.node-chip{
  margin-top:7px;
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}

.chip{
  font-size:11px;
  color:var(--muted);
  border:1px solid var(--border-soft);
  background:rgba(255,255,255,0.02);
  padding:5px 9px;
  border-radius:999px;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* =========================
   Text / Links wrapping
========================= */
.audit .title,
.simple-title{
  overflow-wrap:anywhere;
  word-break:break-word;
}

.audit a,
.simple-desc a{
  overflow-wrap:anywhere;
  word-break:break-word;
  direction:ltr;
  unicode-bidi:plaintext;
}

/* =========================
   Vitals
========================= */
.vitals-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:11px;
  padding-bottom:11px;
  margin-bottom:12px;
  border-bottom:1px solid var(--border);
  flex-wrap:wrap;
}

.vitals-head-title{
  font-weight:700;
}

.vitals-toggle-btn{
  height:32px;
  padding:0 11px;
  border-radius:9px;
  border:1px solid rgba(59, 130, 246,0.45);
  background:linear-gradient(90deg, rgba(23, 58, 115,0.22), rgba(59, 130, 246,0.14));
  color:var(--text);
  font-family:inherit;
  font-size:11px;
  font-weight:900;
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
  box-shadow:0 0 0 1px rgba(59, 130, 246,0.08);
}

.vitals-toggle-btn:hover{
  transform:translateY(-1px);
  border-color:rgba(59, 130, 246,0.70);
  box-shadow:0 0 0 2.67px rgba(59, 130, 246,0.14);
  background:linear-gradient(90deg, rgba(23, 58, 115,0.30), rgba(59, 130, 246,0.20));
}

.vitals-toggle-btn:active{
  transform:translateY(0);
}

:root[data-theme="light"] .vitals-toggle-btn{
  color:#1e1b4b;
  background:linear-gradient(90deg, rgba(29, 78, 216,0.14), rgba(37, 99, 235,0.10));
  border-color:rgba(29, 78, 216,0.28);
  box-shadow:0 7px 16px rgba(37, 99, 235,0.10);
}

:root[data-theme="light"] .vitals-toggle-btn:hover{
  background:linear-gradient(90deg, rgba(29, 78, 216,0.18), rgba(37, 99, 235,0.14));
  border-color:rgba(29, 78, 216,0.38);
}

.vitals-grid{
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  gap:11px;
  margin-bottom:12px;
}

.vital-item{
  padding:12px !important;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  justify-content:flex-start;
}

:root[data-theme="light"] .vital-item.card{
  background:linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241,246,252,0.98));
  border:1px solid rgba(15,23,42,0.12);
  box-shadow:
    0 7px 18px rgba(15,23,42,0.06),
    inset 0 1px 0 rgba(255,255,255,0.96);
}

.vital-title{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1.78px;
  text-align:center;
  min-height:46px;
}

.vital-title-en{
  font-weight:700;
  font-size:12px;
  direction:ltr;
}

.vital-title-fa{
  font-size:10px;
  color:var(--muted);
  line-height:1.6;
}

.vital-value{
  font-size:21px;
  font-weight:900;
  line-height:1;
  margin-top:7px;
  margin-bottom:0;
  letter-spacing:-0.27px;
  text-align:center;
  direction:ltr;
  unicode-bidi:isolate;
  font-variant-numeric:lining-nums;
  font-family:Arial, "Segoe UI", Roboto, sans-serif;
}

.vital-desc-more{
  display:none;
  margin-top:9px;
  font-size:11px;
  color:var(--muted);
  line-height:1.9;
  text-align:center;
}

#vitalsCard.open .vital-desc-more{
  display:block;
}

/* =========================
   Light Theme Contrast Patch
========================= */
:root[data-theme="light"] .kv,
:root[data-theme="light"] .small,
:root[data-theme="light"] .card-sub,
:root[data-theme="light"] .acc-sub,
:root[data-theme="light"] .simple-desc,
:root[data-theme="light"] .thumb-time,
:root[data-theme="light"] .cat-score-caption,
:root[data-theme="light"] .vital-title-fa,
:root[data-theme="light"] .acc-hint{
  color:#475569;
}

:root[data-theme="light"] .section-title,
:root[data-theme="light"] .card-title,
:root[data-theme="light"] .acc-title,
:root[data-theme="light"] .simple-title,
:root[data-theme="light"] .audit .title,
:root[data-theme="light"] .cat-name,
:root[data-theme="light"] .vitals-head-title{
  color:#0f172a;
  font-weight:900;
}

:root[data-theme="light"] .audit-list,
:root[data-theme="light"] .filmstrip,
:root[data-theme="light"] .acc,
:root[data-theme="light"] .cat-section{
  background:linear-gradient(180deg, rgba(239,244,250,0.98), rgba(232,239,247,0.98));
  border:1px solid rgba(15,23,42,0.12);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.70);
}

:root[data-theme="light"] .acc-summary{
  background:linear-gradient(180deg, rgba(250,252,255,0.98), rgba(241,246,252,0.98));
  border-bottom:1px solid rgba(15,23,42,0.08);
}

:root[data-theme="light"] .acc-summary:hover{
  background:linear-gradient(180deg, rgba(237,242,255,0.98), rgba(229,236,248,0.98));
  border-color:rgba(37, 99, 235,0.14);
}

:root[data-theme="light"] .acc[data-open="1"] .acc-summary{
  background:linear-gradient(180deg, rgba(231,238,250,1), rgba(223,232,246,1));
  border-bottom:1px solid rgba(15,23,42,0.12);
}

:root[data-theme="light"] .acc-body{
  background:rgba(248,251,255,0.96);
  border-top:1px solid rgba(15,23,42,0.10);
}

:root[data-theme="light"] .simple-item,
:root[data-theme="light"] .audit{
  background:linear-gradient(180deg, rgba(255,255,255,0.96), rgba(243,248,253,0.96));
  border:1px solid rgba(15,23,42,0.12);
}

:root[data-theme="light"] .simple-item:hover,
:root[data-theme="light"] .audit:hover{
  background:linear-gradient(180deg, rgba(241,246,255,0.98), rgba(233,240,250,0.98));
  border-color:rgba(37, 99, 235,0.16);
}

:root[data-theme="light"] .pill,
:root[data-theme="light"] .chip,
:root[data-theme="light"] .chev{
  background:rgba(236,242,248,0.98);
  border:1px solid rgba(15,23,42,0.14);
  color:#334155;
}

:root[data-theme="light"] .chev{
  color:#334155;
  font-weight:900;
}

:root[data-theme="light"] .overview-gauge-head,
:root[data-theme="light"] .overview-summery-resources,
:root[data-theme="light"] .overview-shot-head,
:root[data-theme="light"] .vitals-filmstrip-head,
:root[data-theme="light"] .card-head,
:root[data-theme="light"] .cat-hero,
:root[data-theme="light"] .vitals-head{
  border-bottom:1px solid rgba(15,23,42,0.12);
}

:root[data-theme="light"] :focus-visible{
  outline:2.67px solid rgba(37, 99, 235,0.45);
  outline-offset:2.67px;
}

/* =========================
   Responsive
========================= */
@media (max-width: 1200px){
  .vitals-grid{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px){
  .topbar-center { justify-content:end; padding-left: 80px;}
  
  .app{
    grid-template-columns:1fr;
    padding:12px;
  }

  .sidebar{
    position:fixed;
    top:12px;
    right:12px;
    width:min(88vw, 285px);
    height:calc(100vh - 25px);
    transform:translateX(110%);
    transition:transform .25s ease;
    z-index:2000;
  }

  .sidebar::before{
    border-radius:21px;
  }

  body.sidebar-open .sidebar{
    transform:translateX(0);
  }

  body.sidebar-open .overlay{
    opacity:1;
    pointer-events:auto;
  }

  .col-4{ grid-column:span 12; }
  .main{ padding:3.56px 0 16px; }
  .overview-grid{ grid-template-columns:1fr; }
  .final-shot{ aspect-ratio:16/10; max-height:285px; }
  .hamburger{ display:flex; }
  .acc-sub{ max-width:62vw; }
}

@media (max-width: 900px){
  .col-9,
  .col-3{
    grid-column:span 12;
  }

  .device-tab-score {
    display: none !important;
  }

  .header-left{
    display:none !important;
  }

  .header.card.sticky-topbar{
    grid-template-columns:auto 1fr auto;
    align-items:start;
    row-gap:7px;
  }

  .header-right{
    display:flex;
    align-items:center;
    gap:9px;
  }

  .result-topbar-meta{
    grid-column:1 / -1;
    grid-row:2;
    order:10;
    flex-basis:100%;
    width:100%;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:5px;
  }

  .result-topbar-meta .legend{
    width:100%;
  }

  .meta{
    display:flex;
    align-items:center;
    gap:5px;
    white-space:nowrap;
  }

  #metaUrl{
    max-width:42vw;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .topbar-center{
    justify-content:flex-end;
  }
}

@media (max-width: 760px){
  .vitals-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:11px;
  }

  .vital-item{
    width:100%;
    min-height:116px;
  }

  .vital-item-last{
    grid-column:1 / -1;
    width:calc((100% - 11px) / 2);
    max-width:calc((100% - 11px) / 2);
    min-width:calc((100% - 11px) / 2);
    min-height:116px;
    justify-self:center;
  }

  .vital-title{
    min-height:auto;
  }

  .vital-value{
    font-size:20px;
  }

  .vitals-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:9px;
    flex-wrap:nowrap;
  }

  .vitals-toggle-btn{
    width:auto;
    height:28px;
    padding:0 9px;
    font-size:10px;
    border-radius:8px;
    flex:0 0 auto;
  }
}

@media (max-width: 700px){
  #metaUrl{
    max-width:82vw;
  }
}

@media (max-width: 640px){
  .theme-toggle{
    display:none !important;
  }
}

@media (max-width: 520px){
  #metaUrl{
    max-width:86vw;
  }

  .sticky-topbar .topbar-center{
    display:none;
  }

  .app{
    padding:9px;
  }

  .card{
    padding:12px;
  }

  .device-switch-wrap{
    width:100%;
  }

  .device-switch{
    width:100%;
    box-sizing:border-box;
  }

  .device-tab{
    flex:1;
    min-width:0;
    padding:5px 7px 5px 5px;
    gap:7px;
  }

  .device-tab-icon{
    width:32px;
    height:32px;
    border-radius:10px;
  }

  .device-tab-icon svg{
    width:16px;
    height:16px;
  }

  .device-tab-title{
    font-size:11px;
  }

  .device-tab-score{
    min-width:25px;
    height:25px;
    font-size:11px;
  }
}

@media (max-width: 480px){
  .vital-value{
    font-size:18px;
  }
}