:root {
  --void: #050608;
  --void-grad: linear-gradient(165deg, #050608 0%, #0a0e14 45%, #07090d 100%);
  --glow-a: rgba(47, 107, 255, 0.18);
  --glow-b: rgba(255, 93, 122, 0.14);
  --glow-c: rgba(255, 200, 87, 0.08);
  --aurora: conic-gradient(from 120deg at 30% 40%, rgba(94, 231, 255, 0.08), transparent 30%, rgba(255, 93, 122, 0.07), transparent 65%, rgba(94, 231, 255, 0.05));
  --panel: rgba(12, 16, 22, 0.78);
  --panel-shine: rgba(255,255,255,0.04);
  --line: rgba(170, 210, 255, 0.1);
  --ink: #eef5ff;
  --muted: #a9b8cc;
  --head-bright: #eef4fb;
  --head-bright-tag: #c5d2e3;
  --cpu: #5ee7ff;
  --cpu-deep: #2f6bff;
  --gpu: #ff5d7a;
  --gpu-soft: #ffb0bd;
  --gpu-deep: #ffb347;
  --ram: #ffc857;
  --ram-hi: #ffe29a;
  --ram-lo: #c4892a;
  --ok: #6dffb0;
  --ok-deep: #2ec4b6;
  --warn: #ff9f43;
  --hot: #ff4d4d;
  --track: rgba(255,255,255,0.14);
  --meter-bg: rgba(255,255,255,0.12);
  --chip-bg: rgba(255,255,255,0.045);
  --fan-case: #7defff;
  --fan-gpu: #ff8fa0;
  --fan-case-bg: rgba(94, 231, 255, 0.08);
  --fan-case-line: rgba(94, 231, 255, 0.1);
  --fan-case-glow: rgba(94, 231, 255, 0.28);
  --fan-gpu-bg: rgba(255, 93, 122, 0.1);
  --fan-gpu-line: rgba(255, 93, 122, 0.14);
  --fan-gpu-glow: rgba(255, 93, 122, 0.35);
  --spark-cpu: #5ee7ff;
  --spark-gpu: #ff5d7a;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --text-glow-cpu: 0 0 18px rgba(94, 231, 255, 0.25);
  --text-glow-gpu: 0 0 18px rgba(255, 93, 122, 0.3);
  --text-glow-ram: 0 0 28px rgba(255, 200, 87, 0.28);
  --bar-glow-cpu: 0 0 16px rgba(94, 231, 255, 0.35);
  --bar-glow-gpu: 0 0 16px rgba(255, 93, 122, 0.35);
  --bar-glow-ram: 0 0 24px rgba(255, 200, 87, 0.35);
  --bar-glow-ok: 0 0 14px rgba(109, 255, 176, 0.3);
  --shimmer: rgba(255,255,255,0.45);
  --scan-opacity: 0.35;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="light"] {
  --void: #f3f6fb;
  --void-grad: linear-gradient(165deg, #fbfcfe 0%, #e9eef6 48%, #f5f7fb 100%);
  --glow-a: rgba(29, 78, 216, 0.1);
  --glow-b: rgba(190, 18, 60, 0.07);
  --glow-c: rgba(180, 83, 9, 0.07);
  --aurora: conic-gradient(from 140deg at 35% 40%, rgba(2, 132, 199, 0.1), transparent 32%, rgba(190, 18, 60, 0.07), transparent 68%, rgba(2, 132, 199, 0.05));
  --panel: rgba(255, 255, 255, 0.88);
  --panel-shine: rgba(255,255,255,0.65);
  --line: rgba(30, 50, 80, 0.14);
  --ink: #0f1a2a;
  --muted: #4a5d73;
  --head-bright: #142033;
  --head-bright-tag: #2a3d52;
  --cpu: #1d4ed8;
  --cpu-deep: #1e3a8a;
  --gpu: #be123c;
  --gpu-soft: #9f1239;
  --gpu-deep: #c2410c;
  --ram: #b45309;
  --ram-hi: #fbbf24;
  --ram-lo: #92400e;
  --ok: #047857;
  --ok-deep: #0f766e;
  --warn: #c2410c;
  --hot: #b91c1c;
  --track: rgba(20, 32, 51, 0.18);
  --meter-bg: rgba(20, 32, 51, 0.12);
  --chip-bg: rgba(20, 32, 51, 0.05);
  --fan-case: #1d4ed8;
  --fan-gpu: #be123c;
  --fan-case-bg: rgba(29, 78, 216, 0.08);
  --fan-case-line: rgba(29, 78, 216, 0.2);
  --fan-case-glow: rgba(29, 78, 216, 0.38);
  --fan-gpu-bg: rgba(190, 18, 60, 0.08);
  --fan-gpu-line: rgba(190, 18, 60, 0.18);
  --fan-gpu-glow: rgba(190, 18, 60, 0.32);
  --spark-cpu: #1d4ed8;
  --spark-gpu: #be123c;
  --shadow: 0 14px 32px rgba(30, 50, 80, 0.1);
  --text-glow-cpu: none;
  --text-glow-gpu: none;
  --text-glow-ram: none;
  --bar-glow-gpu: 0 0 10px rgba(190, 18, 60, 0.18);
  --bar-glow-ram: 0 0 12px rgba(180, 83, 9, 0.18);
  --bar-glow-ok: 0 0 10px rgba(4, 120, 87, 0.18);
  --shimmer: rgba(255,255,255,0.7);
  --scan-opacity: 0.08;
}

/* Color e-ink: flat colors, pure white bg, no blur/glow */
html[data-theme="eink"] {
  --void: #ffffff;
  --void-grad: #ffffff;
  --glow-a: transparent;
  --glow-b: transparent;
  --glow-c: transparent;
  --aurora: transparent;
  --panel: #ffffff;
  --panel-shine: transparent;
  --line: #1a1a1a;
  --ink: #111111;
  --muted: #444444;
  --head-bright: #1a1a1a;
  --head-bright-tag: #333333;
  --cpu: #0050c8;
  --cpu-deep: #003a94;
  --gpu: #c4002b;
  --gpu-soft: #a00024;
  --gpu-deep: #d43800;
  --ram: #a05a00;
  --ram-hi: #c47a00;
  --ram-lo: #7a4500;
  --ok: #007a3d;
  --ok-deep: #006033;
  --warn: #c45a00;
  --hot: #b00000;
  --track: #c8c4ba;
  --meter-bg: #e8e8e8;
  --chip-bg: #f5f5f5;
  --fan-case: #0050c8;
  --fan-gpu: #c4002b;
  --fan-case-bg: #e8eef8;
  --fan-case-line: #0050c8;
  --fan-case-glow: #0050c8;
  --fan-gpu-bg: #f8e8ec;
  --fan-gpu-line: #c4002b;
  --fan-gpu-glow: #c4002b;
  --spark-cpu: #0050c8;
  --spark-gpu: #c4002b;
  --shadow: none;
  --text-glow-cpu: none;
  --text-glow-gpu: none;
  --text-glow-ram: none;
  --bar-glow-gpu: none;
  --bar-glow-ram: none;
  --bar-glow-ok: none;
  --shimmer: transparent;
  --scan-opacity: 0;
  --ease: linear;
}

/* B&W e-ink: pure greyscale, max contrast */
html[data-theme="eink-bw"] {
  --void: #ffffff;
  --void-grad: #ffffff;
  --glow-a: transparent;
  --glow-b: transparent;
  --glow-c: transparent;
  --aurora: transparent;
  --panel: #ffffff;
  --panel-shine: transparent;
  --line: #000000;
  --ink: #000000;
  --muted: #333333;
  --head-bright: #000000;
  --head-bright-tag: #222222;
  --cpu: #000000;
  --cpu-deep: #111111;
  --gpu: #000000;
  --gpu-soft: #111111;
  --gpu-deep: #222222;
  --ram: #000000;
  --ram-hi: #222222;
  --ram-lo: #000000;
  --ok: #000000;
  --ok-deep: #111111;
  --warn: #000000;
  --hot: #000000;
  --track: #c0c0c0;
  --meter-bg: #e0e0e0;
  --chip-bg: #f5f5f5;
  --fan-case: #000000;
  --fan-gpu: #000000;
  --fan-case-bg: #f0f0f0;
  --fan-case-line: #000000;
  --fan-case-glow: #000000;
  --fan-gpu-bg: #f0f0f0;
  --fan-gpu-line: #000000;
  --fan-gpu-glow: #000000;
  --spark-cpu: #000000;
  --spark-gpu: #000000;
  --shadow: none;
  --text-glow-cpu: none;
  --text-glow-gpu: none;
  --text-glow-ram: none;
  --bar-glow-gpu: none;
  --bar-glow-ram: none;
  --bar-glow-ok: none;
  --shimmer: transparent;
  --scan-opacity: 0;
  --ease: linear;
}

/* DarkDeck — orange gauges / blue bars / corner brackets (USB theme look) */
html[data-theme="darkdeck"] {
  --void: #0a0e14;
  --void-grad: #0a0e14;
  --glow-a: transparent;
  --glow-b: transparent;
  --glow-c: transparent;
  --aurora: transparent;
  --panel: #0d1219;
  --panel-shine: transparent;
  --line: rgba(160, 175, 195, 0.28);
  --ink: #e8e8e8;
  --muted: #cccccc;
  --head-bright: #cccccc;
  --head-bright-tag: #aaaaaa;
  --cpu: #f7bd71;
  --cpu-deep: #f8b133;
  --gpu: #f7bd71;
  --gpu-soft: #f8b133;
  --gpu-deep: #e09a40;
  --ram: #3e8fe5;
  --ram-hi: #5aa3f0;
  --ram-lo: #2a6bb8;
  --ok: #3e8fe5;
  --ok-deep: #2a6bb8;
  --warn: #f7bd71;
  --hot: #ff6b4a;
  --track: rgba(255, 255, 255, 0.12);
  --meter-bg: rgba(255, 255, 255, 0.08);
  --chip-bg: rgba(20, 26, 34, 0.95);
  --fan-case: #f7bd71;
  --fan-gpu: #f7bd71;
  --fan-case-bg: rgba(247, 189, 113, 0.08);
  --fan-case-line: rgba(247, 189, 113, 0.35);
  --fan-case-glow: rgba(247, 189, 113, 0.25);
  --fan-gpu-bg: rgba(247, 189, 113, 0.08);
  --fan-gpu-line: rgba(247, 189, 113, 0.35);
  --fan-gpu-glow: rgba(247, 189, 113, 0.25);
  --spark-cpu: #f7bd71;
  --spark-gpu: #f7bd71;
  --shadow: none;
  --text-glow-cpu: none;
  --text-glow-gpu: none;
  --text-glow-ram: none;
  --bar-glow-cpu: none;
  --bar-glow-gpu: none;
  --bar-glow-ram: none;
  --bar-glow-ok: none;
  --shimmer: transparent;
  --scan-opacity: 0;
  --ease: linear;
  --dd-corner: #c8c8c8;
  --dd-bar: #3e8fe5;
  --dd-accent: #f7bd71;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 110%; /* čitljivost iz daljine */
}

html, body {
  height: 100%;
  color: var(--ink);
  background: var(--void);
  font-family: "Chakra Petch", sans-serif;
  overflow: hidden;
}

.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

.void {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(1000px 600px at 10% 0%, var(--glow-a), transparent 55%),
    radial-gradient(900px 700px at 90% 15%, var(--glow-b), transparent 50%),
    radial-gradient(700px 500px at 50% 110%, var(--glow-c), transparent 45%),
    var(--void-grad);
}

.aurora {
  position: fixed;
  inset: -10%;
  z-index: -2;
  background: var(--aurora);
  filter: blur(40px);
  animation: none;
  opacity: 0.85;
  transition: opacity 2s ease;
}

.aurora.hot {
  opacity: 1;
  filter: blur(36px) saturate(1.35);
}

@keyframes aurora-drift {
  from { transform: rotate(0deg) scale(1.05); }
  to { transform: rotate(18deg) scale(1.15); }
}

.scan {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0, 0, 0, 0.08) 2px 3px
  );
  opacity: var(--scan-opacity);
  mix-blend-mode: multiply;
}

.frame {
  height: 100%;
  padding: 0.85rem 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.4rem 0.15rem;
}

.hdr-left, .hdr-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo {
  width: 25px;
  height: 25px;
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.28);
  cursor: pointer;
}

body.vd-collapsed .hdr-right {
  display: none;
}

.title {
  font-size: 0.805rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.subtitle {
  font-size: 0.504rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-top: 0.1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
  background: color-mix(in srgb, var(--ok) 10%, transparent);
  color: var(--ok);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}

.pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
  animation: live 1.4s ease-in-out infinite;
}

@keyframes live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.clock {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.fs-btn,
.theme-btn {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--cpu) 40%, transparent);
  background: color-mix(in srgb, var(--cpu) 10%, transparent);
  color: var(--cpu);
  font-family: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.fs-btn:active,
.theme-btn:active {
  background: color-mix(in srgb, var(--cpu) 22%, transparent);
}

/* Undo/redo icon buttons */
.hdr-edit-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.theme-btn--icon {
  padding: 0.35rem 0.45rem !important;
  min-width: auto !important;
  font-size: 0.72rem !important;
  line-height: 1;
}

.theme-btn--icon svg {
  display: block;
  pointer-events: none;
}

.theme-btn--icon[disabled] {
  opacity: 0.35;
  cursor: default;
  background: transparent !important;
  border-color: color-mix(in srgb, var(--cpu) 15%, transparent) !important;
}

@media (display-mode: fullscreen), (display-mode: standalone) {
  .fs-btn { display: none; }
}

.stage {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1.1fr 1.35fr 0.5fr; /* RAM/VRAM wider for used/total */
  grid-template-rows: 1.25fr 0.95fr 0.95fr;
  grid-template-areas:
    "cpu gpu ram"
    "disks disks ram"
    "fans fans ram";
}

.mod {
  position: relative;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, var(--panel-shine), transparent 35%),
    var(--panel);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--ink) 6%, transparent),
    var(--shadow);
  backdrop-filter: blur(14px);
  padding: 0.85rem 1rem 1rem;
  overflow: hidden;
  animation: rise 0.85s var(--ease) both;
}

.mod::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.03) 48%, transparent 56%);
  background-size: 220% 100%;
  animation: none;
  pointer-events: none;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes glass-sweep {
  0%, 100% { background-position: 120% 0; }
  50% { background-position: -20% 0; }
}

.cpu { grid-area: cpu; animation-delay: 0.04s; }
.gpu { grid-area: gpu; animation-delay: 0.1s; }
.ram { grid-area: ram; animation-delay: 0.16s; }
.fans { grid-area: fans; animation-delay: 0.22s; }
.disks { grid-area: disks; animation-delay: 0.28s; }

.cpu,
.gpu,
.fans {
  padding-top: 0.85rem;
  padding-bottom: 0.9rem;
}

.cpu .mod-head,
.gpu .mod-head,
.fans .mod-head {
  margin-bottom: 0.45rem;
}

.cpu .gauge,
.gpu .gauge {
  width: min(33.6%, 128px); /* −1/5 */
}

.cpu .gauge-num,
.gpu .gauge-num {
  font-size: clamp(1.5rem, 2.8vw, 2.3rem);
}

.mod-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

/* CPU / GPU / Memory naslovi — veći, svjetliji, mirna boja */
.cpu .mod-head,
.gpu .mod-head,
.ram .mod-head {
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  color: var(--head-bright);
}

.cpu .mod-head,
.gpu .mod-head {
  justify-content: flex-start;
  gap: 0.4em;
  white-space: nowrap;
}

.ram .mod-head {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap !important;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem;
  white-space: nowrap;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  min-width: 0;
  overflow: hidden;
}

.ram .mod-head > span:first-child {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ram .mod-head .tag {
  flex: 0 0 auto;
  font-size: 0.62rem !important;
  letter-spacing: 0.02em !important;
  white-space: nowrap;
  opacity: 0.95;
  color: var(--head-bright-tag);
  font-weight: 650;
  text-transform: none;
}

.cpu .mod-head .tag,
.gpu .mod-head .tag {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  opacity: 0.9;
  color: var(--head-bright-tag);
}

.cpu .mod-head .tag::before,
.gpu .mod-head .tag::before {
  content: ": ";
}

.mod-head .tag {
  letter-spacing: 0.08em;
  text-transform: none;
  opacity: 0.75;
}

.mod-body {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  height: calc(100% - 1.4rem);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.inline-fan {
  flex: 0 0 min(160px, 34%);
  width: min(160px, 34%);
  max-width: min(160px, 34%);
  align-self: stretch;
  display: flex;
  min-width: 96px;
  max-height: 100%;
  overflow: hidden;
}

.inline-fan .fan-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  padding: 0.2rem 0.2rem;
  gap: 0.1rem;
  border-radius: 10px;
  overflow: hidden;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
}

.inline-fan .fan-svg {
  width: min(96px, 18vh, 90%);
  height: min(96px, 18vh, 90%);
  flex-shrink: 1;
  overflow: visible;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4))
          drop-shadow(0 0 6px color-mix(in srgb, var(--fan-case) 24%, transparent));
}

.inline-fan .fan-card.gpu-fan .fan-svg {
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4))
          drop-shadow(0 0 6px color-mix(in srgb, var(--fan-gpu) 24%, transparent));
}

.inline-fan .fan-name {
  font-size: clamp(0.48rem, 1.15vh, 0.65rem);
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-fan .fan-rpm {
  font-size: clamp(0.825rem, 2.25vh, 1.275rem); /* ×1.5 */
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-weight: 700;
}

.inline-fan .fan-rpm::after {
  content: " RPM";
  font-size: 0.65em;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.inline-fan .fan-rpm[data-v="—"]::after {
  content: none;
}

.gauge {
  position: relative;
  width: min(33.6%, 136px); /* −1/5 */
  aspect-ratio: 1;
  flex-shrink: 0;
}

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

.g-track {
  fill: none;
  stroke: var(--track);
  stroke-width: 12;
}

.g-value {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 490.088;
  stroke-dashoffset: 490.088;
  transition: stroke-dashoffset 0.12s linear;
}

.gauge-core {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.gauge-num {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.cpu .gauge-num { color: var(--cpu); }
.gpu .gauge-num { color: var(--gpu); }

#cpuGrad stop:nth-child(1) { stop-color: var(--cpu); }
#cpuGrad stop:nth-child(2) { stop-color: var(--cpu-deep); }
#gpuGrad stop:nth-child(1) { stop-color: var(--gpu); }
#gpuGrad stop:nth-child(2) { stop-color: var(--gpu-deep); }

#cpu-ring { stroke: url(#cpuGrad); }
#gpu-ring { stroke: url(#gpuGrad); }

.gauge-unit {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  margin-top: 0.15rem;
}

.side {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  justify-content: center;
}

.side-rest {
  display: flex;
  flex-direction: column;
  gap: inherit;
  min-width: 0;
  overflow: hidden;
}

.metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.metric.compact .m-value { font-size: 1.15rem; }

.m-label {
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--head-bright);
  margin-bottom: 0.12rem;
}

.m-value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 0.12s linear, text-shadow 0.12s linear;
}

.accent-cpu { color: var(--cpu); text-shadow: var(--text-glow-cpu); }
.accent-gpu { color: var(--gpu-soft); text-shadow: var(--text-glow-gpu); animation: power-glow 2.6s ease-in-out infinite; }

@keyframes power-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

.thermo {
  margin-top: 0.35rem;
  height: 5px;
  border-radius: 999px;
  background: var(--meter-bg);
  overflow: hidden;
}

.thermo i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cpu), var(--warn), var(--hot));
  transition: width 0.12s linear;
}

/* Clock scales: malo deblje od disk barova (14px → 17px) */
.thermo.clk {
  height: 17px;
  margin-top: 0.4rem;
}

.thermo.clk i {
  background: linear-gradient(90deg, var(--gpu), var(--gpu-deep));
  box-shadow: var(--bar-glow-gpu);
}

.thermo.clk.cpu-clk i {
  background: linear-gradient(90deg, var(--cpu), var(--cpu-deep));
  box-shadow: var(--bar-glow-cpu);
}

.vram-block { margin-top: 0.1rem; }
.vram-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--head-bright);
  margin-bottom: 0.3rem;
}

.meter {
  height: 9px;
  border-radius: 999px;
  background: var(--meter-bg);
  overflow: hidden;
  position: relative;
}

.meter i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gpu), var(--gpu-deep));
  box-shadow: var(--bar-glow-gpu);
  transition: width 0.12s linear;
  position: relative;
}

.meter i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--shimmer), transparent);
  transform: translateX(-120%);
  animation: shimmer 3.2s ease-in-out infinite;
}

/* disk bar — bez shimmer animacije */
.disk-meter i::after {
  content: none;
  animation: none;
  display: none;
}

@keyframes shimmer {
  0% { transform: translateX(-120%); }
  55%, 100% { transform: translateX(120%); }
}

.spark {
  width: 100%;
  height: 42px;
  opacity: 0.9;
  margin-top: 0.15rem;
}

/* RAM + VRAM side by side — no module head */
.mem-duo {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  min-height: 0;
  position: relative;
  z-index: 1;
  padding-top: 0.15rem;
}

.mem-pane {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  justify-items: center;
  align-items: center;
  gap: 0.14rem;
  min-height: 0;
  min-width: 0;
}

.vram-pane {
  grid-template-rows: auto auto auto 1fr;
}

.mem-pane-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--head-bright);
}

.ram-stage {
  height: calc(100% - 1.3rem);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  justify-items: center;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  z-index: 1;
}

.ram-pct {
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1;
  color: var(--ram);
  text-shadow: var(--text-glow-ram);
  animation: floaty 4.5s ease-in-out infinite;
}

.vram-pct {
  color: var(--gpu-soft);
  text-shadow: var(--text-glow-gpu);
}

.ram-unit {
  color: var(--head-bright-tag);
  letter-spacing: 0.16em;
  font-size: 0.68rem;
  margin-top: -0.1rem;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.ram-column {
  width: min(70px, 65%);
  height: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--ram) 28%, transparent);
  background: var(--chip-bg);
  position: relative;
  overflow: visible;
  container-type: size;
}

.vram-column {
  border-color: color-mix(in srgb, var(--gpu) 30%, transparent);
}

.ram-grid {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to top,
    transparent 0 11px,
    color-mix(in srgb, var(--ink) 6%, transparent) 11px 12px
  );
  pointer-events: none;
  z-index: 1;
}

.ram-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, var(--ram-hi), var(--ram) 45%, var(--ram-lo));
  box-shadow: var(--bar-glow-ram);
  transition: height 0.12s linear;
  z-index: 0;
  opacity: 0.45;
}

.vram-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, var(--gpu-soft), var(--gpu) 45%, var(--gpu-deep));
  box-shadow: var(--bar-glow-gpu);
  transition: height 0.12s linear;
  z-index: 0;
  opacity: 0.45;
}

.vram-meter {
  width: 100%;
  height: 10px;
  margin-top: 0.1rem;
  align-self: stretch;
}

.vram-meter i {
  background: linear-gradient(90deg, var(--gpu), var(--gpu-deep));
  box-shadow: var(--bar-glow-gpu);
}

.vram-meter i::after {
  display: none;
  animation: none;
  content: none;
}

.ram-text {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  padding-left: 4px;
  margin: 0;
  font-size: clamp(0.38rem, 18cqw, 0.62rem);
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  line-height: 1.15;
  max-width: none;
  white-space: nowrap;
  overflow: visible;
  text-shadow:
    0 0 3px var(--void),
    0 1px 2px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

/* Fans */
.fan-row {
  height: calc(100% - 1.35rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
  position: relative;
  z-index: 1;
}

.fan-card {
  border-radius: 16px;
  border: 1px solid var(--fan-case-line);
  background: radial-gradient(circle at 50% 35%, var(--fan-case-bg), var(--chip-bg) 55%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem;
  transition: border-color 0.8s ease, box-shadow 0.8s ease;
}

/* Cooling: animacija + ime lijevo, broj/RPM desno · sve ×1.5 */
.fan-row .fan-card-h {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.55rem 0.85rem;
  min-height: 0;
}

.fan-side-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 0 0 auto;
}

.fan-side-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.1rem;
  min-width: 0;
  flex: 1 1 auto;
  text-align: right;
}

.fan-row .fan-card-h .fan-name {
  font-size: 1.17rem; /* 0.78 × 1.5 */
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--head-bright);
}

.fan-row .fan-card-h .fan-svg {
  width: min(138px, 24vh); /* ×2 */
  height: min(138px, 24vh);
}

/* D2/D3/D4 fans — 70% of default (−30%) */
.fan-row .fan-card-h[data-key="D2"] .fan-svg,
.fan-row .fan-card-h[data-key="D3"] .fan-svg,
.fan-row .fan-card-h[data-key="D4"] .fan-svg {
  width: min(77px, 13.6vh); /* ~56% of original 138 */
  height: min(77px, 13.6vh);
}

.fan-row .fan-card-h .fan-rpm {
  font-size: 1.575rem; /* 1.05 × 1.5 */
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.fan-row .fan-card-h .fan-rpm-unit {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--head-bright);
}

.fan-card.spinning {
  border-color: var(--fan-case-glow);
  box-shadow: 0 0 24px color-mix(in srgb, var(--fan-case) 18%, transparent);
}

/* Running fans (RPM > 0): black fill, theme-colored edges */
.fan-card:not(.fan-idle) .fan-frame,
.fan-card:not(.fan-idle) .fan-blades path,
.fan-card:not(.fan-idle) .fan-hub {
  fill: #0a0a0a;
}

.fan-card:not(.fan-idle) .fan-svg {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4))
          drop-shadow(0 0 8px color-mix(in srgb, currentColor 28%, transparent));
}

/* Idle (0 RPM): much darker theme tint */
.fan-card.fan-idle {
  color: color-mix(in srgb, var(--fan-case) 28%, #050508) !important;
}

.fan-card.gpu-fan.fan-idle {
  color: color-mix(in srgb, var(--fan-gpu) 28%, #050508) !important;
}

.fan-card.fan-idle .fan-svg {
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5))
          drop-shadow(0 0 6px color-mix(in srgb, currentColor 18%, transparent));
  opacity: 0.85;
}

.fan-card.gpu-fan {
  background: radial-gradient(circle at 50% 35%, var(--fan-gpu-bg), var(--chip-bg) 55%);
  border-color: var(--fan-gpu-line);
}

.fan-card.gpu-fan.spinning {
  border-color: var(--fan-gpu-glow);
  box-shadow: 0 0 24px color-mix(in srgb, var(--fan-gpu) 18%, transparent);
}

.fan-svg {
  width: min(92px, 14vw);
  height: min(92px, 14vw);
  overflow: visible;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35))
          drop-shadow(0 0 10px color-mix(in srgb, var(--fan-case) 22%, transparent));
}

.fan-card.gpu-fan .fan-svg {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35))
          drop-shadow(0 0 10px color-mix(in srgb, var(--fan-gpu) 22%, transparent));
}

@keyframes fan-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fan-rotor {
  /* Parent g is translate(60 60) — spin around local origin, compositor-friendly */
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform;
  backface-visibility: hidden;
}

.fan-hub,
.fan-frame {
  fill: currentColor;
}

.fan-edge,
.fan-rim,
.fan-screw-ring,
.fan-blades path,
.fan-hub {
  stroke: currentColor;
  paint-order: stroke fill;
}

.fan-hub-core {
  fill: #0a0a0a;
}

.fan-name {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--head-bright);
}

.fan-rpm {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

/* Disks */
.disk-row {
  height: calc(100% - 1.35rem);
  display: grid;
  /* 3 stupca: SSD (lijevo) · HDD (sredina) · USB (desno) — fiksni redoslijed */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.disk {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--chip-bg);
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 0;
}

.disk-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.disk-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--head-bright);
}

.disk-temp {
  font-size: 1rem;
  font-weight: 700;
  transition: color 0.12s linear, text-shadow 0.12s linear;
}

.disk-meta {
  color: var(--head-bright-tag);
  font-size: 0.88rem;
  font-weight: 600;
}

.disk-meter {
  height: 14px;
  border-radius: 999px;
  background: var(--meter-bg);
  overflow: hidden;
}

.disk-meter i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ok-deep), var(--ok));
  box-shadow: var(--bar-glow-ok);
  transition: width 0.12s linear, background 0.12s linear;
  position: relative;
}

.disk.warn .disk-meter i {
  background: linear-gradient(90deg, var(--warn), var(--gpu));
  box-shadow: var(--bar-glow-gpu);
}

/* === 7" secondary screen (landscape HUD, no scroll) === */
@media (max-height: 820px) and (min-width: 900px),
       (max-width: 1280px) and (max-height: 900px) and (min-width: 900px) {
  html, body { overflow: hidden; }

  .frame {
    padding: 0.35rem 0.55rem 0.45rem;
    gap: 0.35rem;
  }

  .hdr {
    padding: 0.1rem 0.2rem 0;
  }

  .hdr-left, .hdr-right {
    gap: 0.4rem;
  }

  .logo {
    width: 20px;
    height: 20px;
    border-radius: 4px;
  }

  .title {
    font-size: 0.574rem;
    letter-spacing: 0.12em;
  }

  .subtitle {
    display: none;
  }

  .pill {
    font-size: 0.55rem;
    padding: 0.18rem 0.4rem;
    letter-spacing: 0.1em;
  }

  .pill i {
    width: 5px;
    height: 5px;
  }

  .clock {
    font-size: 0.85rem;
  }

  .fs-btn,
  .theme-btn {
    font-size: 0.55rem;
    padding: 0.22rem 0.45rem;
    letter-spacing: 0.08em;
  }

  .stage {
    gap: 0.35rem;
    grid-template-columns: 1.05fr 1.3fr 0.48fr; /* RAM/VRAM wider for used/total */
    /* disks middle = 1/4 (1 / 4) — NOT the old ~60% 1.8fr row */
    grid-template-rows: 1.5fr 1fr 1.5fr;
  }

  html[data-device="note2"] .stage,
  html[data-device="note3c"] .stage {
    gap: 0.75rem;
    grid-template-columns: 1.15fr 1.45fr 0.9fr;
    grid-template-rows: 1.3fr 1.15fr 1.1fr;
  }

  .mod {
    border-radius: 12px;
    padding: 0.45rem 0.55rem 0.5rem;
  }

  .mod-head {
    margin-bottom: 0.25rem;
    font-size: 0.58rem;
    letter-spacing: 0.12em;
  }

  .cpu .mod-head,
  .gpu .mod-head,
  .ram .mod-head {
    font-size: 0.78rem;
    color: var(--head-bright);
  }

  .cpu .mod-head .tag,
  .gpu .mod-head .tag,
  .ram .mod-head .tag {
    font-size: 0.68rem;
    color: var(--head-bright-tag);
  }

  .mod-body {
    gap: 0.45rem;
  }

  .inline-fan {
    flex: 0 0 min(88px, 28%);
    width: min(88px, 28%);
    max-width: min(88px, 28%);
    min-width: 64px;
  }

  .inline-fan .fan-card {
    padding: 0.12rem 0.1rem;
    gap: 0.05rem;
    border-radius: 8px;
  }

  .inline-fan .fan-svg {
    width: min(72px, 16vh, 85%);
    height: min(72px, 16vh, 85%);
  }

  .inline-fan .fan-name {
    font-size: clamp(0.4rem, 1vh, 0.52rem);
  }

  .inline-fan .fan-rpm {
    font-size: clamp(0.63rem, 1.725vh, 0.87rem); /* ×1.5 */
  }

  .gauge {
    width: min(30.4%, 45px); /* −1/5 */
  }

  .gauge-num {
    font-size: clamp(0.58rem, 1.2vw, 0.78rem);
  }

  .gauge-unit {
    font-size: 0.55rem;
    margin-top: 0.05rem;
  }

  .g-track,
  .g-value {
    stroke-width: 9;
  }

  .side {
    gap: 0.25rem;
  }

  .m-label {
    font-size: 0.72rem;
    font-weight: 650;
    color: var(--head-bright);
    margin-bottom: 0;
  }

  .m-value {
    font-size: 0.95rem;
  }

  .metric.compact .m-value {
    font-size: 0.85rem;
  }

  .thermo {
    margin-top: 0.15rem;
    height: 4px;
  }

  .thermo.clk {
    height: 10px; /* disk 8px → malo deblje */
  }

  .vram-top {
    font-size: 0.72rem;
    font-weight: 650;
    color: var(--head-bright);
    margin-bottom: 0.15rem;
  }

  .meter {
    height: 7px;
  }

  .spark {
    height: 28px;
    margin-top: 0;
  }

  .ram-pct {
    font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  }

  .ram-unit {
    font-size: 0.6rem;
    margin-top: -0.2rem;
  }

  .ram-column {
    width: 36px;
    min-height: 0;
    border-radius: 10px;
  }

  .ram-text {
    font-size: 0.68rem;
  }

  .fan-row {
    gap: 0.3rem;
    height: calc(100% - 1rem);
  }

  .fan-card {
    border-radius: 10px;
    padding: 0.25rem 0.2rem;
    gap: 0.15rem;
  }

  .fan-svg {
    width: min(56px, 9vw);
    height: min(56px, 9vw);
  }

  .fan-row .fan-card-h .fan-svg {
    width: min(84px, 16vh); /* ×2 */
    height: min(84px, 16vh);
  }

  .fan-row .fan-card-h .fan-name {
    font-size: 0.78rem;
  }

  .fan-row .fan-card-h .fan-rpm {
    font-size: 1.05rem;
  }

  .fan-name {
    font-size: 0.52rem;
    letter-spacing: 0.08em;
  }

  .fan-rpm {
    font-size: 0.7rem;
  }

  .disk-row {
    gap: 0.3rem;
    height: calc(100% - 1rem);
  }

  .disk {
    border-radius: 10px;
    padding: 0.4rem 0.5rem;
    gap: 0.25rem;
  }

  .disk-name {
    font-size: 0.78rem;
  }

  .disk-temp {
    font-size: 0.72rem;
  }

  .disk-meta {
    font-size: 0.62rem;
    margin: 0;
  }

  .disk-meter {
    height: 8px;
  }

  .bar {
    margin-top: 0.35rem;
    height: 6px;
  }

  .bar.tall {
    height: 10px;
    margin-top: 0.4rem;
  }
}

/* Very short 7" landscape panels (e.g. 1024×600) — drop sparklines for space */
@media (max-height: 640px) and (orientation: landscape) {
  html:not([data-device="note2"]):not([data-device="note3c"]):not([data-device="nxtpaper70"]):not([data-device="iphone7"]) .spark { display: none; }
  html:not([data-device="note2"]):not([data-device="note3c"]):not([data-device="nxtpaper70"]):not([data-device="iphone7"]) .subtitle,
  html:not([data-device="note2"]):not([data-device="note3c"]):not([data-device="nxtpaper70"]):not([data-device="iphone7"]) .pill span { display: none; }
  html:not([data-device="note2"]):not([data-device="note3c"]):not([data-device="nxtpaper70"]):not([data-device="iphone7"]) .stage {
    /* disks middle = 1/4 */
    grid-template-rows: 1.5fr 1fr 1.5fr;
  }

  /* disk kartice = 12.5vh (pola od 25vh) */
  html:not([data-device="note2"]):not([data-device="note3c"]):not([data-device="iphone7"]) .mod.disks {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
  }

  html:not([data-device="note2"]):not([data-device="note3c"]):not([data-device="iphone7"]) .disk-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    height: 12.5vh !important;
    max-height: 12.5vh !important;
    min-height: 12.5vh !important;
  }

  html:not([data-device="note2"]):not([data-device="note3c"]):not([data-device="iphone7"]) .disk {
    height: 12.5vh !important;
    max-height: 12.5vh !important;
    min-height: 12.5vh !important;
    box-sizing: border-box !important;
  }
}

/* === Portrait mode (7" tablet etc.) === */
@media (orientation: portrait) {
  html, body {
    overflow: hidden;
    height: 100%;
  }

  .frame {
    padding: 0.4rem 0.5rem 0.5rem;
    gap: 0.35rem;
    height: 100%;
  }

  .hdr {
    padding: 0.05rem 0.15rem 0;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .hdr-left, .hdr-right {
    gap: 0.35rem;
  }

  .logo {
    width: 20px;
    height: 20px;
    border-radius: 4px;
  }

  .title {
    font-size: 0.595rem;
    letter-spacing: 0.12em;
  }

  .subtitle {
    display: none;
  }

  .pill {
    font-size: 0.52rem;
    padding: 0.16rem 0.38rem;
  }

  .pill i {
    width: 5px;
    height: 5px;
  }

  .clock {
    font-size: 0.8rem;
  }

  .fs-btn,
  .theme-btn {
    font-size: 0.52rem;
    padding: 0.2rem 0.42rem;
    letter-spacing: 0.06em;
  }

  .stage {
    flex: 1;
    min-height: 0;
    height: auto;
    gap: 0.35rem;
    grid-template-columns: 1fr 1fr;
    grid-template-rows:
      minmax(0, 0.575fr)
      minmax(0, 0.72fr)
      minmax(0, 1.4fr)
      minmax(0, 0.475fr);
    grid-template-areas:
      "cpu gpu"
      "ram ram"
      "disks disks"
      "fans fans";
  }

  html[data-device="note2"] .stage,
  html[data-device="note3c"] .stage {
    gap: 0.65rem;
    grid-template-rows:
      minmax(0, 1.35fr)
      minmax(0, 0.9fr)
      minmax(0, 1.1fr)
      minmax(0, 1.2fr);
  }

  .mod {
    border-radius: 12px;
    padding: 0.45rem 0.5rem 0.5rem;
    min-height: 0;
  }

  .mod-head {
    margin-bottom: 0.2rem;
    font-size: 0.55rem;
    letter-spacing: 0.1em;
  }

  .cpu .mod-head,
  .gpu .mod-head,
  .ram .mod-head {
    font-size: 0.75rem;
    color: var(--head-bright);
  }

  .cpu .mod-head .tag,
  .gpu .mod-head .tag,
  .ram .mod-head .tag {
    font-size: 0.65rem;
    color: var(--head-bright-tag);
  }

  .mod-body {
    gap: 0.4rem;
    height: calc(100% - 1.1rem);
    min-height: 0;
  }

  .inline-fan {
    flex: 0 0 min(84px, 30%);
    width: min(84px, 30%);
    max-width: min(84px, 30%);
    min-width: 60px;
  }

  .inline-fan .fan-card {
    padding: 0.1rem 0.08rem;
  }

  .inline-fan .fan-svg {
    width: min(68px, 14vh, 80%);
    height: min(68px, 14vh, 80%);
  }

  .inline-fan .fan-rpm {
    font-size: clamp(0.6rem, 1.65vh, 0.825rem); /* ×1.5 */
  }

  .gauge {
    width: min(42%, 54px);
  }

  .gauge-num {
    font-size: clamp(0.55rem, 2.8vw, 0.72rem);
  }

  .gauge-unit {
    font-size: 0.52rem;
  }

  .g-track,
  .g-value {
    stroke-width: 9;
  }

  .side {
    gap: 0.2rem;
  }

  .m-label {
    font-size: 0.7rem;
    font-weight: 650;
    color: var(--head-bright);
  }

  .m-value {
    font-size: 0.9rem;
  }

  .metric.compact .m-value {
    font-size: 0.8rem;
  }

  .thermo {
    height: 4px;
    margin-top: 0.1rem;
  }

  .thermo.clk {
    height: 10px; /* disk 8px → malo deblje */
  }

  .vram-top {
    font-size: 0.7rem;
    font-weight: 650;
    color: var(--head-bright);
    margin-bottom: 0.1rem;
  }

  .meter {
    height: 7px;
  }

  .spark {
    display: none;
  }

  /* RAM becomes horizontal strip in portrait */
  .ram .ram-stage {
    height: calc(100% - 1.1rem);
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "pct bar"
      "txt bar";
    justify-items: stretch;
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0.15rem;
  }

  .ram-pct {
    grid-area: pct;
    font-size: clamp(1.6rem, 7vw, 2.2rem);
    justify-self: start;
  }

  .ram-unit {
    display: none;
  }

  .ram-column {
    grid-area: bar;
    width: 100%;
    height: 100%;
    min-height: 36px;
    max-height: 52px;
    border-radius: 10px;
    align-self: stretch;
  }

  .ram-grid {
    background: repeating-linear-gradient(
      to right,
      transparent 0 11px,
      color-mix(in srgb, var(--ink) 6%, transparent) 11px 12px
    );
  }

  .ram-fill {
    /* fill grows horizontally in portrait */
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: 0%;
    height: 100% !important;
    transition: width 0.12s linear;
    background: linear-gradient(90deg, var(--ram-lo), var(--ram) 45%, var(--ram-hi));
  }

  .ram-text {
    grid-area: txt;
    justify-self: start;
    font-size: 0.68rem;
  }

  .fan-row {
    grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    gap: 0.28rem;
    height: calc(100% - 1rem);
  }

  .fan-card {
    border-radius: 10px;
    padding: 0.2rem 0.15rem;
    gap: 0.12rem;
  }

  .fan-svg {
    width: min(52px, 14vw);
    height: min(52px, 14vw);
  }

  .fan-name {
    font-size: 0.48rem;
    letter-spacing: 0.06em;
  }

  .fan-rpm {
    font-size: 0.62rem;
  }

  .disk-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.28rem;
    height: calc(100% - 1rem);
  }

  .disk {
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    gap: 0.2rem;
    justify-content: center;
  }

  .disk-name {
    font-size: 0.78rem;
  }

  .disk-temp {
    font-size: 0.7rem;
  }

  .disk-meta {
    font-size: 0.6rem;
  }

  .disk-meter {
    height: 8px;
  }

  .bar {
    margin-top: 0.25rem;
    height: 6px;
  }
}

/* Narrow portrait phones */
@media (orientation: portrait) and (max-width: 480px) {
  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "cpu"
      "gpu"
      "ram"
      "disks"
      "fans";
    overflow: auto;
  }

  html, body { overflow: auto; }

  .fan-row {
    grid-template-columns: repeat(3, 1fr);
    height: auto;
  }

  .mod-body,
  .fan-row,
  .disk-row,
  .ram .ram-stage {
    height: auto;
  }

  .gauge {
    width: 50px;
  }
}

html[data-theme="light"] .scan {
  mix-blend-mode: soft-light;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 3px,
    rgba(20, 32, 51, 0.03) 3px 4px
  );
}

html[data-theme="light"] .fan-hub {
  fill: currentColor;
  stroke: none;
}

html[data-theme="light"] .mod {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.95),
    var(--shadow);
}

html[data-theme="light"] .mod::before {
  opacity: 0.35;
}

html[data-theme="light"] .g-value {
  filter: none;
}

html[data-theme="light"] .aurora.hot {
  filter: blur(42px) saturate(1.1);
}

html[data-theme="light"] .accent-gpu {
  animation: none;
}

html[data-theme="eink"] .void,
html[data-theme="eink"] .aurora,
html[data-theme="eink"] .scan,
html[data-theme="eink-bw"] .void,
html[data-theme="eink-bw"] .aurora,
html[data-theme="eink-bw"] .scan {
  display: none;
}

html[data-theme="light"] .logo {
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

/* ——— Color E-ink ——— */
html[data-theme="eink"] body,
html[data-theme="eink"] .frame,
html[data-theme="eink"] .stage {
  background: #ffffff;
}

html[data-theme="eink"] .mod {
  border-radius: 10px;
  border: 2px solid var(--line);
  backdrop-filter: none;
  box-shadow: none;
  background: #ffffff;
  animation: none;
}

html[data-theme="eink"] .mod::before {
  display: none;
  animation: none;
}

html[data-theme="eink"] .logo {
  box-shadow: none;
}

html[data-theme="eink"] .g-value {
  filter: none;
  stroke-width: 14;
}

html[data-theme="eink"] .g-track {
  stroke-width: 14;
  stroke: #c8c4ba;
}

html[data-theme="eink"] .fan-card,
html[data-theme="eink"] .disk {
  border-width: 2px;
  border-radius: 10px;
  box-shadow: none;
}

html[data-theme="eink"] .fan-card.spinning,
html[data-theme="eink"] .fan-card.gpu-fan.spinning {
  box-shadow: none;
}

html[data-theme="eink"] .fan-svg,
html[data-theme="eink"] .fan-card.gpu-fan .fan-svg {
  filter: none;
}

html[data-theme="eink"] .fan-hub,
html[data-theme="eink"] .fan-frame,
html[data-theme="eink"] .fan-blades path {
  fill: currentColor;
  stroke: currentColor;
}

html[data-theme="eink"] .fan-card:not(.fan-idle) .fan-frame,
html[data-theme="eink"] .fan-card:not(.fan-idle) .fan-blades path,
html[data-theme="eink"] .fan-card:not(.fan-idle) .fan-hub {
  fill: #0a0a0a;
  stroke: currentColor;
}

html[data-theme="eink"] .fan-edge,
html[data-theme="eink"] .fan-rim,
html[data-theme="eink"] .fan-screw-ring {
  stroke: currentColor;
}

html[data-theme="eink"] .pill {
  border-width: 2px;
  border-color: #007a3d;
  background: #e7f5ec;
  color: #007a3d;
}

html[data-theme="eink"] .pill i {
  animation: none;
  box-shadow: none;
}

html[data-theme="eink"] .fs-btn,
html[data-theme="eink"] .theme-btn {
  border-width: 2px;
  border-color: #0050c8;
  background: #e8eef8;
  color: #0050c8;
}

html[data-theme="eink"] .ram-pct,
html[data-theme="eink"] .accent-cpu,
html[data-theme="eink"] .accent-gpu {
  animation: none;
  text-shadow: none;
  filter: none;
}

html[data-theme="eink"] .bar-fill::after,
html[data-theme="eink"] .meter i::after,
html[data-theme="eink"] .disk-meter i::after {
  display: none;
  animation: none;
}

html[data-theme="eink"] .fan-led {
  animation: none;
}

html[data-theme="eink"] .spark {
  opacity: 1;
}

/* ——— E-ink BW: black & white only ——— */
html[data-theme="eink-bw"] body {
  background: #ffffff;
  color: #000000;
  -webkit-font-smoothing: none;
}

html[data-theme="eink-bw"] .frame,
html[data-theme="eink-bw"] .stage {
  background: #ffffff;
}

html[data-theme="eink-bw"] .mod,
html[data-theme="eink-bw"] .fan-card,
html[data-theme="eink-bw"] .disk {
  border-radius: 8px;
  border: 2px solid #000000;
  backdrop-filter: none;
  box-shadow: none !important;
  background: #ffffff;
  animation: none;
}

html[data-theme="eink-bw"] .mod::before {
  display: none;
}

html[data-theme="eink-bw"] .logo {
  box-shadow: none;
  filter: none;
  border: 2px solid #000000;
  border-radius: 6px;
  background: #ffffff;
}

html[data-theme="eink-bw"] .title,
html[data-theme="eink-bw"] .clock,
html[data-theme="eink-bw"] .fan-rpm,
html[data-theme="eink-bw"] .m-value,
html[data-theme="eink-bw"] .gauge-num,
html[data-theme="eink-bw"] .cpu .gauge-num,
html[data-theme="eink-bw"] .gpu .gauge-num,
html[data-theme="eink-bw"] .accent-cpu,
html[data-theme="eink-bw"] .accent-gpu,
html[data-theme="eink-bw"] .ram-pct,
html[data-theme="eink-bw"] .temp,
html[data-theme="eink-bw"] .subtitle,
html[data-theme="eink-bw"] .muted,
html[data-theme="eink-bw"] .mod-head,
html[data-theme="eink-bw"] .mod-head .tag,
html[data-theme="eink-bw"] .m-label,
html[data-theme="eink-bw"] .gauge-unit,
html[data-theme="eink-bw"] .fan-name,
html[data-theme="eink-bw"] .ram-text,
html[data-theme="eink-bw"] .ram-unit {
  color: #000000 !important;
  text-shadow: none !important;
  filter: none !important;
  animation: none !important;
}

html[data-theme="eink-bw"] .fs-btn,
html[data-theme="eink-bw"] .theme-btn,
html[data-theme="eink-bw"] .fs-btn:hover,
html[data-theme="eink-bw"] .theme-btn:hover,
html[data-theme="eink-bw"] .fs-btn:focus,
html[data-theme="eink-bw"] .theme-btn:focus,
html[data-theme="eink-bw"] .fs-btn:focus-visible,
html[data-theme="eink-bw"] .theme-btn:focus-visible,
html[data-theme="eink-bw"] .fs-btn:active,
html[data-theme="eink-bw"] .theme-btn:active,
html[data-theme="eink-bw"] .pill {
  border: 2px solid #000000 !important;
  background: #ffffff !important;
  color: #000000 !important;
  font-weight: 700 !important;
  border-radius: 6px;
  box-shadow: none !important;
  text-shadow: none !important;
  letter-spacing: 0.1em;
  outline: none;
}

html[data-theme="eink-bw"] .fs-btn:active,
html[data-theme="eink-bw"] .theme-btn:active {
  background: #e8e8e8 !important;
  color: #000000 !important;
}

html[data-theme="eink-bw"] .pill i {
  background: #000000 !important;
  box-shadow: none !important;
  animation: none !important;
  border-radius: 1px;
}

html[data-theme="eink-bw"] .pill span {
  color: #000000 !important;
  font-weight: 700 !important;
}

html[data-theme="eink-bw"] .g-value {
  filter: none !important;
  stroke: #000000 !important;
  stroke-width: 14;
}

html[data-theme="eink-bw"] #cpu-ring,
html[data-theme="eink-bw"] #gpu-ring {
  stroke: #000000 !important;
}

html[data-theme="eink-bw"] .g-track {
  stroke-width: 14;
  stroke: #aaaaaa;
}

html[data-theme="eink-bw"] .fan-card,
html[data-theme="eink-bw"] .fan-card.gpu-fan {
  background: #ffffff;
  border: 2px solid #000000;
}

html[data-theme="eink-bw"] .fan-card.spinning,
html[data-theme="eink-bw"] .fan-card.gpu-fan.spinning {
  border-color: #000000;
  box-shadow: none !important;
}

html[data-theme="eink-bw"] .fan-svg,
html[data-theme="eink-bw"] .fan-card.gpu-fan .fan-svg {
  filter: none !important;
  color: #000000 !important;
}

html[data-theme="eink-bw"] .fan-frame,
html[data-theme="eink-bw"] .fan-blades path,
html[data-theme="eink-bw"] .fan-hub {
  fill: #000000 !important;
  stroke: #000000 !important;
}

html[data-theme="eink-bw"] .fan-edge,
html[data-theme="eink-bw"] .fan-rim,
html[data-theme="eink-bw"] .fan-screw-ring {
  stroke: #000000 !important;
}

html[data-theme="eink-bw"] .fan-hub-core {
  fill: #ffffff !important;
}

html[data-theme="eink-bw"] .fan-hub-inner,
html[data-theme="eink-bw"] .fan-screw,
html[data-theme="eink-bw"] .fan-led {
  display: none !important;
}

html[data-theme="eink-bw"] .fan-led {
  animation: none !important;
  stroke: #000000 !important;
  stroke-opacity: 1 !important;
}

html[data-theme="eink-bw"] .mod.cpu,
html[data-theme="eink-bw"] .mod.gpu {
  overflow: hidden;
}

html[data-theme="eink-bw"] .mod-body {
  overflow: hidden;
  gap: 0.35rem;
}

html[data-theme="eink-bw"] .inline-fan {
  flex: 0 0 min(100px, 28%);
  width: min(100px, 28%);
  max-width: min(100px, 28%);
  min-width: 78px;
  overflow: hidden;
}

html[data-theme="eink-bw"] .inline-fan .fan-card {
  overflow: hidden;
  border: 2px solid #000000;
  padding: 0.15rem 0.12rem;
  gap: 0.06rem;
}

html[data-theme="eink-bw"] .inline-fan .fan-svg {
  width: min(88px, 17vh, 85%);
  height: min(88px, 17vh, 85%);
  overflow: hidden;
  filter: none !important;
}

html[data-theme="eink-bw"] .inline-fan .fan-name,
html[data-theme="eink-bw"] .inline-fan .fan-rpm {
  font-size: clamp(0.5rem, 1.25vh, 0.7rem) !important;
  font-weight: 700 !important;
  line-height: 1.05 !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="eink-bw"] .fan-row .fan-card {
  overflow: hidden;
  min-height: 0;
  gap: 0.12rem;
  padding: 0.3rem 0.25rem;
  justify-content: center;
}

html[data-theme="eink-bw"] .fan-row .fan-svg {
  overflow: hidden;
  width: min(72px, 14vh);
  height: min(72px, 14vh);
  flex-shrink: 0;
}

html[data-theme="eink-bw"] .fan-row .fan-name,
html[data-theme="eink-bw"] .fan-row .fan-rpm {
  font-size: clamp(0.5rem, 1.3vh, 0.75rem) !important;
  line-height: 1.1 !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

html[data-theme="eink-bw"] .meter,
html[data-theme="eink-bw"] .disk-meter,
html[data-theme="eink-bw"] .thermo,
html[data-theme="eink-bw"] .ram-column {
  background: #ffffff;
  border: 2px solid #000000;
  box-shadow: none;
  border-radius: 6px;
}

html[data-theme="eink-bw"] .meter i,
html[data-theme="eink-bw"] .disk-meter i,
html[data-theme="eink-bw"] .disk.warn .disk-meter i,
html[data-theme="eink-bw"] .ram-fill,
html[data-theme="eink-bw"] .thermo i {
  background: #000000 !important;
  box-shadow: none !important;
}

html[data-theme="eink-bw"] .meter i::after,
html[data-theme="eink-bw"] .disk-meter i::after,
html[data-theme="eink-bw"] .bar-fill::after {
  display: none !important;
  animation: none !important;
}

html[data-theme="eink-bw"] .spark {
  opacity: 1;
  filter: none;
}

html[data-theme="eink-bw"] .ram-pct,
html[data-theme="eink-bw"] .accent-cpu,
html[data-theme="eink-bw"] .accent-gpu {
  animation: none !important;
  text-shadow: none !important;
  filter: none !important;
}

/* =====================================================================
   Device profiles (physical resolutions)
   Note 2:     1872×1404  · 10.3" B&W e-ink · 227 PPI · 4:3
   Note 3C:    2480×1860 B/W · 1240×930 color · 10.3" Kaleido · 4:3
   NXTPAPER 70: 2340×1080  · 6.9" NXTPAPER LCD · ~374 PPI · 19.5:9
   ===================================================================== */

/* —— Boox Note 2 (1872×1404) — full 10.3" layout, not squeezed —— */
html[data-device="note2"] {
  font-size: 105%;
}

html[data-device="note2"] .frame {
  padding: 0.55rem 0.75rem 0.65rem;
  gap: 0.55rem;
}

html[data-device="note2"] .stage {
  gap: 0.65rem;
  grid-template-columns: 1.15fr 1.45fr 0.9fr;
  grid-template-rows: 1.25fr 1.2fr 1.05fr;
}

html[data-device="note2"] .mod {
  border-width: 2px;
  border-radius: 14px;
  padding: 0.7rem 0.85rem 0.8rem;
}

html[data-device="note2"] .cpu,
html[data-device="note2"] .gpu,
html[data-device="note2"] .fans {
  padding-top: 0.7rem;
  padding-bottom: 0.75rem;
}

html[data-device="note2"] .cpu .gauge,
html[data-device="note2"] .gpu .gauge {
  width: min(33.6%, 120px); /* −1/5 */
}

html[data-device="note2"] .cpu .gauge-num,
html[data-device="note2"] .gpu .gauge-num {
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
}

html[data-device="note2"] .inline-fan {
  flex-basis: min(140px, 26%);
  width: min(140px, 26%);
  max-width: min(140px, 26%);
  min-width: 110px;
}

html[data-device="note2"] .inline-fan .fan-svg {
  width: min(144px, 22vh, 90%);
  height: min(144px, 22vh, 90%);
}

html[data-device="note2"] .inline-fan .fan-name {
  font-size: clamp(0.65rem, 1.5vh, 0.9rem);
}

html[data-device="note2"] .inline-fan .fan-rpm {
  font-size: clamp(0.975rem, 2.25vh, 1.35rem); /* ×1.5 */
}

html[data-device="note2"] .fan-row {
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

html[data-device="note2"] .fan-svg {
  width: min(144px, 20vh);
  height: min(144px, 20vh);
}

html[data-device="note2"] .g-track,
html[data-device="note2"] .g-value {
  stroke-width: 14;
}

@media (orientation: portrait) and (min-width: 900px) {
  html[data-device="note2"] .stage {
    grid-template-columns: 1fr 1fr;
    grid-template-rows:
      minmax(0, 1.2fr)
      minmax(0, 0.85fr)
      minmax(0, 1.15fr)
      minmax(0, 0.95fr);
  }

  html[data-device="note2"] .cpu .gauge-num,
  html[data-device="note2"] .gpu .gauge-num {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
  }
}

/* —— Boox Note 3C (2480×1860 / color 1240×930) — full 10.3" layout —— */
html[data-device="note3c"] {
  font-size: 110%;
}

html[data-device="note3c"] .frame {
  padding: 0.6rem 0.85rem 0.7rem;
  gap: 0.6rem;
}

html[data-device="note3c"] .stage {
  gap: 0.7rem;
  grid-template-columns: 1.15fr 1.45fr 0.9fr;
  grid-template-rows: 1.3fr 1.15fr 1.05fr;
}

html[data-device="note3c"] .mod {
  border-radius: 14px;
  padding: 0.75rem 0.9rem 0.85rem;
}

html[data-device="note3c"] .cpu,
html[data-device="note3c"] .gpu,
html[data-device="note3c"] .fans {
  padding-top: 0.75rem;
  padding-bottom: 0.8rem;
}

html[data-device="note3c"] .cpu .gauge,
html[data-device="note3c"] .gpu .gauge {
  width: min(33.6%, 128px); /* −1/5 */
}

html[data-device="note3c"] .cpu .gauge-num,
html[data-device="note3c"] .gpu .gauge-num {
  font-size: clamp(1.5rem, 3vw, 2.3rem);
}

html[data-device="note3c"] .inline-fan {
  flex-basis: min(150px, 26%);
  width: min(150px, 26%);
  max-width: min(150px, 26%);
  min-width: 120px;
}

html[data-device="note3c"] .inline-fan .fan-svg {
  width: min(160px, 24vh, 90%);
  height: min(160px, 24vh, 90%);
}

html[data-device="note3c"] .inline-fan .fan-name {
  font-size: clamp(0.7rem, 1.6vh, 1rem);
}

html[data-device="note3c"] .inline-fan .fan-rpm {
  font-size: clamp(1.05rem, 2.4vh, 1.5rem); /* ×1.5 */
}

html[data-device="note3c"] .fan-row {
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

html[data-device="note3c"] .fan-svg {
  width: min(160px, 22vh);
  height: min(160px, 22vh);
}

/* Note 3C + E-ink: outlined fields like BW e-ink, but with color accents
   (Kaleido color layer ~150 PPI — thick borders & flat panels) */
html[data-device="note3c"][data-theme="eink"] body,
html[data-device="note3c"][data-theme="eink"] .frame,
html[data-device="note3c"][data-theme="eink"] .stage {
  background: #ffffff;
  -webkit-font-smoothing: none;
}

html[data-device="note3c"][data-theme="eink"] .mod,
html[data-device="note3c"][data-theme="eink"] .fan-card,
html[data-device="note3c"][data-theme="eink"] .disk,
html[data-device="note3c"][data-theme="eink"] .inline-fan .fan-card {
  border: 3px solid #111111;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: none !important;
  backdrop-filter: none;
  animation: none;
  overflow: hidden;
}

html[data-device="note3c"][data-theme="eink"] .mod {
  padding: 0.75rem 0.9rem 0.85rem;
}

html[data-device="note3c"][data-theme="eink"] .mod::before {
  display: none;
}

html[data-device="note3c"][data-theme="eink"] .fan-card,
html[data-device="note3c"][data-theme="eink"] .disk {
  background: #ffffff;
}

html[data-device="note3c"][data-theme="eink"] .fan-card.gpu-fan {
  border-color: #c4002b;
}

html[data-device="note3c"][data-theme="eink"] .inline-fan .fan-card {
  border-color: #0050c8;
  padding: 0.2rem 0.15rem;
  gap: 0.08rem;
}

html[data-device="note3c"][data-theme="eink"] .inline-fan .fan-card.gpu-fan {
  border-color: #c4002b;
}

html[data-device="note3c"][data-theme="eink"] .logo {
  box-shadow: none;
  border: 3px solid #111111;
  border-radius: 8px;
}

html[data-device="note3c"][data-theme="eink"] .g-value {
  filter: none !important;
  stroke-width: 16;
}

html[data-device="note3c"][data-theme="eink"] .g-track {
  stroke-width: 16;
  stroke: #c8c4ba;
}

html[data-device="note3c"][data-theme="eink"] #cpu-ring {
  stroke: #0050c8 !important;
}

html[data-device="note3c"][data-theme="eink"] #gpu-ring {
  stroke: #c4002b !important;
}

html[data-device="note3c"][data-theme="eink"] .meter,
html[data-device="note3c"][data-theme="eink"] .disk-meter,
html[data-device="note3c"][data-theme="eink"] .thermo,
html[data-device="note3c"][data-theme="eink"] .ram-column {
  border: 2px solid #111111;
  background: #ffffff;
  box-shadow: none;
  border-radius: 6px;
}

html[data-device="note3c"][data-theme="eink"] .fs-btn,
html[data-device="note3c"][data-theme="eink"] .theme-btn,
html[data-device="note3c"][data-theme="eink"] .pill {
  border: 3px solid #0050c8;
  background: #ffffff;
  color: #0050c8;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: none;
}

html[data-device="note3c"][data-theme="eink"] .pill {
  border-color: #007a3d;
  color: #007a3d;
}

html[data-device="note3c"][data-theme="eink"] .pill i {
  background: #007a3d;
  box-shadow: none;
  animation: none;
}

html[data-device="note3c"][data-theme="eink"] .fan-svg,
html[data-device="note3c"][data-theme="eink"] .fan-card.gpu-fan .fan-svg {
  filter: none !important;
}

html[data-device="note3c"][data-theme="eink"] .fan-hub {
  fill: #ffffff;
  stroke: #111111;
}

html[data-device="note3c"][data-theme="eink"] .fan-hub-inner {
  fill: #e8e8e8;
  stroke: #333333;
}

html[data-device="note3c"][data-theme="eink"] .fan-screw {
  fill: #dddddd;
  stroke: #333333;
}

html[data-device="note3c"][data-theme="eink"] .fan-led {
  animation: none;
}

html[data-device="note3c"][data-theme="eink"] .ram-pct,
html[data-device="note3c"][data-theme="eink"] .accent-cpu,
html[data-device="note3c"][data-theme="eink"] .accent-gpu {
  animation: none;
  text-shadow: none;
  filter: none;
}

html[data-device="note3c"][data-theme="eink"] .meter i::after,
html[data-device="note3c"][data-theme="eink"] .disk-meter i::after,
html[data-device="note3c"][data-theme="eink"] .bar-fill::after {
  display: none;
}

html[data-device="note3c"][data-theme="eink"] .fan-card.spinning,
html[data-device="note3c"][data-theme="eink"] .fan-card.gpu-fan.spinning {
  box-shadow: none !important;
}

@media (orientation: portrait) and (min-width: 1000px) {
  html[data-device="note3c"] .stage {
    grid-template-columns: 1fr 1fr;
    grid-template-rows:
      minmax(0, 1.25fr)
      minmax(0, 0.85fr)
      minmax(0, 1.15fr)
      minmax(0, 1fr);
  }
}

/* —— TCL NXTPAPER 70 (2340×1080 · ~6.9" · 19.5:9) — sve module, ništa skriveno —— */
html[data-device="nxtpaper70"] {
  font-size: 100% !important;
}

html[data-device="nxtpaper70"] .frame {
  padding: 0.28rem 0.4rem 0.32rem !important;
  gap: 0.28rem !important;
  height: 100%;
  box-sizing: border-box;
}

html[data-device="nxtpaper70"] .hdr {
  padding: 0.05rem 0.1rem 0 !important;
  flex-wrap: nowrap;
  gap: 0.3rem;
}

html[data-device="nxtpaper70"] .subtitle {
  display: none !important; /* samo chrome, ne podaci */
}

html[data-device="nxtpaper70"] .title {
  font-size: 0.7rem !important;
  letter-spacing: 0.12em;
}

html[data-device="nxtpaper70"] .hdr-ram {
  display: none !important; /* RAM je u Memory kartici */
}

html[data-device="nxtpaper70"] .theme-btn,
html[data-device="nxtpaper70"] .fs-btn,
html[data-device="nxtpaper70"] .pill {
  font-size: 0.52rem !important;
  padding: 0.2rem 0.4rem !important;
}

html[data-device="nxtpaper70"] .clock {
  font-size: 0.75rem !important;
}

html[data-device="nxtpaper70"] .mod.ram {
  display: block !important;
}

/* Landscape: disk KARTICE (Kingston/Crucial/HDD) = točno 1/4 visine stagea */
@media (orientation: landscape) {
  html[data-device="nxtpaper70"],
  html[data-device="nxtpaper70"] body {
    overflow: hidden !important;
    height: 100% !important;
  }

  html[data-device="nxtpaper70"] .stage {
    gap: 0.3rem !important;
    container-type: size !important;
    grid-template-columns: 1.05fr 1.25fr 0.52fr !important; /* RAM/VRAM wider */
    grid-template-rows: 1.5fr 1fr 1.5fr !important;
    grid-template-areas:
      "cpu gpu fans"
      "disks disks fans"
      "ram ram ram" !important;
    min-height: 0 !important;
  }

  html[data-device="nxtpaper70"] .mod {
    border-radius: 10px !important;
    padding: 0.3rem 0.4rem 0.35rem !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html[data-device="nxtpaper70"] .mod-head {
    margin-bottom: 0.12rem !important;
    font-size: 0.68rem !important;
    font-weight: 650 !important;
    color: var(--head-bright) !important;
  }

  html[data-device="nxtpaper70"] .cpu .mod-head,
  html[data-device="nxtpaper70"] .gpu .mod-head,
  html[data-device="nxtpaper70"] .ram .mod-head {
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: var(--head-bright) !important;
  }

  html[data-device="nxtpaper70"] .ram .mod-head {
    font-size: 0.58rem !important;
    letter-spacing: 0.02em !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    gap: 0.2rem !important;
    overflow: hidden !important;
  }

  html[data-device="nxtpaper70"] .ram .mod-head .tag {
    font-size: 0.52rem !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
  }

  html[data-device="nxtpaper70"] .cpu .mod-head .tag,
  html[data-device="nxtpaper70"] .gpu .mod-head .tag {
    font-size: 0.7rem !important;
    font-weight: 650 !important;
    opacity: 1 !important;
    color: var(--head-bright-tag) !important;
  }

  html[data-device="nxtpaper70"] .mem-pane-label {
    font-size: 0.8rem !important;
    letter-spacing: 0.12em !important;
  }

  html[data-device="nxtpaper70"] .mod-body {
    height: calc(100% - 0.95rem) !important;
    gap: 0.28rem !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html[data-device="nxtpaper70"] .cpu .gauge,
  html[data-device="nxtpaper70"] .gpu .gauge {
    width: min(28.8%, 54px) !important; /* −1/5 od 68px */
  }

  html[data-device="nxtpaper70"] .cpu .gauge-num,
  html[data-device="nxtpaper70"] .gpu .gauge-num {
    font-size: clamp(1rem, 3.4vh, 1.25rem) !important;
  }

  html[data-device="nxtpaper70"] .g-track,
  html[data-device="nxtpaper70"] .g-value {
    stroke-width: 12 !important;
  }

  html[data-device="nxtpaper70"] .m-label {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: var(--head-bright) !important;
  }
  html[data-device="nxtpaper70"] .m-value {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: var(--ink) !important;
  }
  html[data-device="nxtpaper70"] .metric.compact .m-value {
    font-size: 0.85rem !important;
  }

  html[data-device="nxtpaper70"] .spark {
    display: block !important;
    height: 22px !important;
  }

  html[data-device="nxtpaper70"] .inline-fan {
    flex: 0 0 120px !important;
    width: 120px !important;
    max-width: 120px !important;
    min-width: 100px !important;
  }

  html[data-device="nxtpaper70"] .inline-fan .fan-card {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 0.06rem !important;
  }

  html[data-device="nxtpaper70"] .inline-fan .fan-svg {
    width: min(72px, 16vh) !important;
    height: min(72px, 16vh) !important;
  }

  html[data-device="nxtpaper70"] .inline-fan .fan-name {
    font-size: 0.58rem !important;
    font-weight: 700 !important;
    color: var(--head-bright) !important;
  }

  html[data-device="nxtpaper70"] .inline-fan .fan-rpm {
    font-size: 0.87rem !important; /* ×1.5 od 0.58 */
    font-weight: 700 !important;
    color: var(--ink) !important;
  }

  html[data-device="nxtpaper70"] .fan-row {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.35rem !important;
    height: calc(100% - 0.95rem) !important;
  }

  html[data-device="nxtpaper70"] .fan-row .fan-card-h {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.25rem 0.55rem !important;
    gap: 0.45rem !important;
    border-radius: 8px !important;
    background: var(--chip-bg) !important;
  }

  html[data-device="nxtpaper70"] .fan-row .fan-card-h .fan-svg {
    width: min(96px, 28vh) !important; /* ×2 */
    height: min(96px, 28vh) !important;
  }

  html[data-device="nxtpaper70"] .fan-row .fan-card-h .fan-name {
    font-size: 0.87rem !important; /* ×1.5 */
    font-weight: 700 !important;
    color: var(--head-bright) !important;
  }

  html[data-device="nxtpaper70"] .fan-row .fan-card-h .fan-rpm {
    font-size: 1.17rem !important; /* ×1.5 */
    font-weight: 700 !important;
    color: var(--ink) !important;
  }

  html[data-device="nxtpaper70"] .fan-row .fan-card-h .fan-rpm-unit {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    color: var(--head-bright) !important;
  }

  /* === Kingston / Crucial / HDD: VISINA KARTICE = 12.5vh (još ×1/2) === */
  html[data-device="nxtpaper70"] .stage {
    /* srednji red (disks) prati visinu kartica */
    grid-template-rows: 1fr auto 1fr !important;
  }

  html[data-device="nxtpaper70"] .mod.disks {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }

  html[data-device="nxtpaper70"] .disk-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: 12.5vh !important;
    flex: 0 0 auto !important;
    gap: 0.2rem !important;
    height: 12.5vh !important;
    min-height: 12.5vh !important;
    max-height: 12.5vh !important;
  }

  html[data-device="nxtpaper70"] .disk {
    height: 12.5vh !important;
    max-height: 12.5vh !important;
    min-height: 12.5vh !important;
    box-sizing: border-box !important;
    padding: 0.12rem 0.28rem !important;
    gap: 0.05rem !important;
    border-radius: 8px !important;
    justify-content: center !important;
  }

  html[data-device="nxtpaper70"] .disk-name {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: var(--head-bright) !important;
  }
  html[data-device="nxtpaper70"] .disk-temp {
    font-size: 0.68rem !important;
    font-weight: 700 !important;
  }
  html[data-device="nxtpaper70"] .disk-meta {
    font-size: 0.58rem !important;
    font-weight: 650 !important;
    color: var(--head-bright-tag) !important;
  }
  html[data-device="nxtpaper70"] .disk-meter { height: 7px !important; }
  html[data-device="nxtpaper70"] .thermo { height: 4px !important; }
  html[data-device="nxtpaper70"] .thermo.clk { height: 10px !important; } /* disk 7px → malo deblje */
  html[data-device="nxtpaper70"] .meter { height: 8px !important; }
  html[data-device="nxtpaper70"] .vram-top {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: var(--head-bright) !important;
  }
  html[data-device="nxtpaper70"] .ram-pct {
    font-size: clamp(1.35rem, 5.5vh, 1.9rem) !important;
  }
  html[data-device="nxtpaper70"] .ram-unit {
    font-size: 0.7rem !important;
    color: var(--head-bright-tag) !important;
  }
  html[data-device="nxtpaper70"] .ram-text {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    color: var(--head-bright) !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }
  html[data-device="nxtpaper70"] .clock {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
  }
}

/* Portrait TCL: scrollable stack — sve kartice */
@media (orientation: portrait) {
  html[data-device="nxtpaper70"] .hdr-ram {
    display: none !important;
  }

  html[data-device="nxtpaper70"] .mod.ram {
    display: block !important;
  }

  html[data-device="nxtpaper70"],
  html[data-device="nxtpaper70"] body {
    overflow: auto !important;
    height: auto !important;
  }

  html[data-device="nxtpaper70"] .stage {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    grid-template-areas: "cpu" "gpu" "ram" "disks" "fans" !important;
    gap: 0.4rem !important;
    overflow: visible !important;
    height: auto !important;
  }

  html[data-device="nxtpaper70"] .mod {
    min-height: 160px !important;
    padding: 0.5rem 0.55rem !important;
  }

  html[data-device="nxtpaper70"] .spark {
    display: block !important;
    height: 32px !important;
  }

  html[data-device="nxtpaper70"] .cpu .gauge,
  html[data-device="nxtpaper70"] .gpu .gauge {
    width: min(32%, 72px) !important; /* −1/5 od 90px */
  }

  html[data-device="nxtpaper70"] .inline-fan {
    flex: 0 0 120px !important;
    width: 120px !important;
    max-width: 120px !important;
    min-width: 100px !important;
  }

  html[data-device="nxtpaper70"] .inline-fan .fan-svg {
    width: min(96px, 20vw) !important;
    height: min(96px, 20vw) !important;
  }

  html[data-device="nxtpaper70"] .disk-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* =====================================================================
   Landscape-first for Boox Note 2 / Note 3C
   — full layout: CPU|GPU|RAM / fans / disks — nothing hidden
   — inner fan "cards" flattened
   ===================================================================== */

.hdr-ram {
  display: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 0.28rem 0.55rem;
  border: 2px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
}

/* Real Boox tablet battery (from /api/stats via ADB).
   Visibility is driven by the `hidden` attribute — JS removes it only
   when the server reports an attached Boox device. */
.hdr-battery {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.55rem 0.22rem 0.6rem;
  border: 2px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  line-height: 1;
}
.hdr-battery[hidden] { display: none !important; }
.hdr-battery .hb-icon { color: var(--ink); flex-shrink: 0; }
.hdr-battery .hb-fill { transition: width 0.4s ease; }
.hdr-battery .hb-pct {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  min-width: 2.9em;
  text-align: right;
}
/* color states */
.hdr-battery.bat-ok    { border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); }
.hdr-battery.bat-low   { border-color: color-mix(in srgb, var(--warn, #ffb020) 55%, transparent); color: var(--warn, #ffb020); }
.hdr-battery.bat-crit  { border-color: color-mix(in srgb, var(--danger, #ff4d4d) 60%, transparent); color: var(--danger, #ff4d4d); }
.hdr-battery.bat-chg   { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.hdr-battery.bat-crit.bat-chg .hb-pct { color: var(--danger, #ff4d4d); }

/* Show header RAM + hide RAM module on landscape e-ink tablets */
@media (orientation: landscape) {
  /* RAM in header only on Boox tablets — PC keeps Memory module */
  html[data-device="note2"] .hdr-ram,
  html[data-device="note3c"] .hdr-ram {
    display: none !important;
  }

  html[data-device="note2"] .mod.ram,
  html[data-device="note3c"] .mod.ram {
    display: block !important;
  }

  html[data-device="note2"],
  html[data-device="note3c"] {
    font-size: 108%;
  }

  html[data-device="note2"] .stage,
  html[data-device="note3c"] .stage {
    gap: 0.7rem !important;
    grid-template-columns: 1.05fr 1.3fr 0.5fr !important; /* RAM/VRAM wider */
    grid-template-rows: 1.35fr 0.85fr 1fr !important;
    grid-template-areas:
      "cpu gpu ram"
      "disks disks ram"
      "fans fans ram" !important;
  }

  html[data-device="note2"] .frame,
  html[data-device="note3c"] .frame {
    padding: 0.45rem 0.7rem 0.55rem !important;
    gap: 0.4rem !important;
  }

  html[data-device="note2"] .mod,
  html[data-device="note3c"] .mod {
    padding: 0.55rem 0.75rem 0.6rem !important;
    border-radius: 12px !important;
    min-height: 0;
  }

  html[data-device="note2"] .cpu .gauge,
  html[data-device="note2"] .gpu .gauge,
  html[data-device="note3c"] .cpu .gauge,
  html[data-device="note3c"] .gpu .gauge {
    width: min(28.8%, 120px) !important; /* −1/5 */
  }

  html[data-device="note2"] .cpu .gauge-num,
  html[data-device="note2"] .gpu .gauge-num,
  html[data-device="note3c"] .cpu .gauge-num,
  html[data-device="note3c"] .gpu .gauge-num {
    font-size: clamp(1.5rem, 3.5vh, 2.3rem) !important;
  }

  /* Flatten inline fan — no nested card chrome */
  html[data-device="note2"] .inline-fan .fan-card,
  html[data-device="note3c"] .inline-fan .fan-card {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0.1rem !important;
    border-radius: 0 !important;
  }

  html[data-device="note2"] .inline-fan,
  html[data-device="note3c"] .inline-fan {
    flex: 0 0 min(130px, 22%) !important;
    width: min(130px, 22%) !important;
    max-width: min(130px, 22%) !important;
    min-width: 100px !important;
  }

  html[data-device="note2"] .inline-fan .fan-svg,
  html[data-device="note3c"] .inline-fan .fan-svg {
    width: min(156px, 28vh, 90%) !important;
    height: min(156px, 28vh, 90%) !important;
  }

  /* Cooling: flat cells, not heavy nested cards */
  html[data-device="note2"] .fan-row .fan-card,
  html[data-device="note3c"] .fan-row .fan-card {
    background: transparent !important;
    box-shadow: none !important;
    border-width: 2px !important;
    border-radius: 8px !important;
    padding: 0.35rem 0.25rem !important;
    gap: 0.2rem !important;
  }

  html[data-device="note2"] .fan-row,
  html[data-device="note3c"] .fan-row {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
    height: calc(100% - 1.2rem) !important;
  }

  html[data-device="note2"] .fan-svg,
  html[data-device="note3c"] .fan-svg {
    width: min(140px, 24vh) !important;
    height: min(140px, 24vh) !important;
  }

  html[data-device="note2"] .disk-row,
  html[data-device="note3c"] .disk-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.45rem !important;
    height: calc(100% - 1.2rem) !important;
  }

  html[data-device="note2"] .spark,
  html[data-device="note3c"] .spark {
    display: block !important;
    height: 36px !important;
  }

  html[data-theme="eink-bw"] .hdr-ram {
    border-color: #000 !important;
    color: #000 !important;
    font-weight: 700;
  }

  html[data-theme="eink"] .hdr-ram {
    border-color: #0050c8;
    color: #111;
    font-weight: 700;
  }
}


/* Portrait e-ink: keep 2×2 + show RAM card again */
@media (orientation: portrait) {
  html[data-device="note2"] .hdr-ram,
  html[data-device="note3c"] .hdr-ram {
    display: none;
  }

  html[data-device="note2"] .mod.ram,
  html[data-device="note3c"] .mod.ram {
    display: block !important;
  }

  html[data-device="note2"] .stage,
  html[data-device="note3c"] .stage {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows:
      minmax(0, 1.25fr)
      minmax(0, 0.85fr)
      minmax(0, 1.15fr)
      minmax(0, 1fr) !important;
    grid-template-areas: "cpu gpu" "ram ram" "disks disks" "fans fans" !important;
    gap: 0.6rem !important;
  }
}


/* —— iPhone 7 / SE (1334×750 · CSS 667×375 landscape · 16:9) —— */
html[data-device="iphone7"] {
  font-size: 100% !important;
}

html[data-device="iphone7"] .frame {
  padding: 0.18rem 0.28rem 0.2rem !important;
  gap: 0.18rem !important;
  height: 100%;
  box-sizing: border-box;
}

html[data-device="iphone7"] .hdr {
  padding: 0 !important;
  flex-wrap: nowrap;
  gap: 0.22rem;
  min-height: 0;
}

html[data-device="iphone7"] .logo {
  width: 16px !important;
  height: 16px !important;
  border-radius: 3px !important;
}

html[data-device="iphone7"] .subtitle {
  display: none !important;
}

html[data-device="iphone7"] .title {
  font-size: 0.58rem !important;
  letter-spacing: 0.1em;
  line-height: 1.1;
}

html[data-device="iphone7"] .hdr-ram {
  display: none !important;
}

html[data-device="iphone7"] .theme-btn,
html[data-device="iphone7"] .fs-btn,
html[data-device="iphone7"] .pill {
  font-size: 0.48rem !important;
  padding: 0.12rem 0.28rem !important;
  letter-spacing: 0.06em !important;
}

html[data-device="iphone7"] .pill span {
  display: none !important;
}

html[data-device="iphone7"] .pill i {
  width: 5px !important;
  height: 5px !important;
  margin: 0 !important;
}

html[data-device="iphone7"] .clock {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
}

html[data-device="iphone7"] .mod.ram {
  display: block !important;
}

html[data-device="iphone7"] .spark {
  display: none !important;
}

@media (orientation: landscape) {
  html[data-device="iphone7"],
  html[data-device="iphone7"] body {
    overflow: hidden !important;
    height: 100% !important;
  }

  /* Sve iznad CPU / Storage / Memory — sakrij header */
  html[data-device="iphone7"] .hdr {
    display: none !important;
  }

  html[data-device="iphone7"] .frame {
    padding: 0.12rem 0.2rem 0.14rem !important;
    gap: 0 !important;
  }

  html[data-device="iphone7"] .stage {
    gap: 0.18rem !important;
    container-type: size !important;
    grid-template-columns: 1.05fr 1.05fr 0.48fr !important;
    grid-template-rows: 1fr 1fr 0.5fr !important; /* CPU / GPU / fans; disks gore, fans do memorije */
    grid-template-areas:
      "cpu disks ram"
      "gpu disks ram"
      "fans fans ram" !important;
    min-height: 0 !important;
    height: 100% !important;
  }

  html[data-device="iphone7"] .mod {
    border-radius: 8px !important;
    padding: 0.18rem 0.28rem 0.2rem !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html[data-device="iphone7"] .cpu,
  html[data-device="iphone7"] .gpu {
    overflow: visible !important;
  }

  html[data-device="iphone7"] .mod-head {
    margin-bottom: 0.06rem !important;
    font-size: 0.55rem !important;
    font-weight: 700 !important;
    color: var(--head-bright) !important;
  }

  html[data-device="iphone7"] .cpu .mod-head .tag,
  html[data-device="iphone7"] .gpu .mod-head .tag,
  html[data-device="iphone7"] .disks .mod-head .tag,
  html[data-device="iphone7"] .fans .mod-head .tag {
    display: none !important;
  }

  html[data-device="iphone7"] .mod-body {
    height: calc(100% - 0.7rem) !important;
    gap: 0.16rem !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* CPU/GPU: naslov + Temp/Edge u istoj liniji; ventilator ispod kruga */
  html[data-device="iphone7"] .cpu,
  html[data-device="iphone7"] .gpu {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    column-gap: 0.28rem !important;
    row-gap: 0.08rem !important;
  }

  html[data-device="iphone7"] .cpu .mod-body,
  html[data-device="iphone7"] .gpu .mod-body,
  html[data-device="iphone7"] .cpu .side,
  html[data-device="iphone7"] .gpu .side {
    display: contents !important;
  }

  html[data-device="iphone7"] .cpu .mod-head,
  html[data-device="iphone7"] .gpu .mod-head {
    grid-column: 1 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    align-self: baseline !important;
  }

  html[data-device="iphone7"] .cpu .metric-head-pair,
  html[data-device="iphone7"] .gpu .metric-head-pair {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    gap: 0.28rem !important;
    min-width: 0 !important;
  }

  html[data-device="iphone7"] .cpu .metric-head-pair .m-label,
  html[data-device="iphone7"] .gpu .metric-head-pair .m-label {
    margin: 0 !important;
    font-size: 0.52rem !important;
  }

  html[data-device="iphone7"] .cpu .metric-head-pair .m-value,
  html[data-device="iphone7"] .gpu .metric-head-pair .m-value {
    font-size: 0.72rem !important;
    line-height: 1 !important;
  }

  html[data-device="iphone7"] .cpu .metric-head-pair .thermo {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 2.5rem !important;
    max-width: 4.5rem !important;
    height: 4px !important;
    margin: 0 !important;
    align-self: center !important;
  }

  html[data-device="iphone7"] .cpu .gauge,
  html[data-device="iphone7"] .gpu .gauge {
    grid-column: 1 !important;
    grid-row: 2 !important;
    align-self: center !important;
    justify-self: center !important;
    width: 57px !important;
  }

  html[data-device="iphone7"] .cpu .gauge-num,
  html[data-device="iphone7"] .gpu .gauge-num {
    font-size: clamp(1.1rem, 5.5vh, 1.35rem) !important;
  }

  html[data-device="iphone7"] .cpu .side-rest,
  html[data-device="iphone7"] .gpu .side-rest {
    grid-column: 2 !important;
    grid-row: 2 / 4 !important; /* pored kruga + ventilatora */
    align-self: stretch !important;
    justify-content: center !important;
    min-width: 0 !important;
    min-height: 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.12rem !important;
    overflow: visible !important;
  }

  html[data-device="iphone7"] .cpu .side-rest .metric,
  html[data-device="iphone7"] .gpu .side-rest .metric {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.04rem !important;
    min-width: 0 !important;
  }

  html[data-device="iphone7"] .cpu .side-rest .metric-row,
  html[data-device="iphone7"] .gpu .side-rest .metric-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.2rem !important;
    min-width: 0 !important;
  }

  html[data-device="iphone7"] .cpu .side-rest .thermo,
  html[data-device="iphone7"] .gpu .side-rest .thermo {
    display: block !important;
    width: 100% !important;
    height: 4px !important;
  }

  html[data-device="iphone7"] .cpu .side-rest .thermo.clk,
  html[data-device="iphone7"] .gpu .side-rest .thermo.clk {
    height: 6px !important;
  }

  html[data-device="iphone7"] .cpu .inline-fan,
  html[data-device="iphone7"] .gpu .inline-fan {
    grid-column: 1 !important;
    grid-row: 3 !important;
    justify-self: center !important;
    align-self: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  html[data-device="iphone7"] .cpu .inline-fan .fan-svg,
  html[data-device="iphone7"] .gpu .inline-fan .fan-svg {
    width: min(28px, 7vh) !important;
    height: min(28px, 7vh) !important;
  }

  html[data-device="iphone7"] .gauge-unit {
    font-size: 0.45rem !important;
  }

  html[data-device="iphone7"] .g-track,
  html[data-device="iphone7"] .g-value {
    stroke-width: 14 !important;
  }

  html[data-device="iphone7"] .m-label {
    font-size: 0.52rem !important;
    font-weight: 700 !important;
    color: var(--head-bright) !important;
  }

  html[data-device="iphone7"] .m-value {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
  }

  html[data-device="iphone7"] .metric.compact .m-value {
    font-size: 0.64rem !important;
  }

  html[data-device="iphone7"] .thermo {
    height: 3px !important;
  }

  html[data-device="iphone7"] .thermo.clk {
    height: 6px !important;
  }

  html[data-device="iphone7"] .side {
    gap: 0.1rem !important;
    min-width: 0 !important;
  }

  html[data-device="iphone7"] .metric-row {
    gap: 0.2rem !important;
  }

  html[data-device="iphone7"] .inline-fan {
    flex: 0 0 52px !important;
    width: 52px !important;
    max-width: 52px !important;
    min-width: 48px !important;
  }

  html[data-device="iphone7"] .inline-fan .fan-card {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 0.02rem !important;
  }

  html[data-device="iphone7"] .inline-fan .fan-svg {
    width: min(40px, 11vh) !important;
    height: min(40px, 11vh) !important;
  }

  html[data-device="iphone7"] .inline-fan .fan-name {
    display: none !important;
  }

  html[data-device="iphone7"] .inline-fan .fan-rpm {
    font-size: 0.58rem !important;
    font-weight: 700 !important;
  }

  html[data-device="iphone7"] .fan-row {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.18rem !important;
    height: calc(100% - 0.7rem) !important;
  }

  html[data-device="iphone7"] .fan-row .fan-card-h {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.06rem 0.3rem !important;
    gap: 0.25rem !important;
    border-radius: 6px !important;
    background: var(--chip-bg) !important;
    max-height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html[data-device="iphone7"] .fan-row .fan-card-h .fan-svg {
    width: min(18px, 4.75vh) !important; /* −50% od 36px */
    height: min(18px, 4.75vh) !important;
  }

  html[data-device="iphone7"] .fan-row .fan-card-h .fan-name {
    font-size: 0.48rem !important;
    font-weight: 700 !important;
  }

  html[data-device="iphone7"] .fan-row .fan-card-h .fan-rpm {
    font-size: 0.65rem !important;
    font-weight: 700 !important;
  }

  html[data-device="iphone7"] .fan-row .fan-card-h .fan-rpm-unit {
    font-size: 0.42rem !important;
  }

  html[data-device="iphone7"] .mod.disks {
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }

  html[data-device="iphone7"] .disk-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: 1fr !important;
    flex: 1 1 auto !important;
    gap: 0.14rem !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  html[data-device="iphone7"] .disk {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    padding: 0.08rem 0.18rem !important;
    gap: 0.02rem !important;
    border-radius: 6px !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  html[data-device="iphone7"] .disk-name {
    font-size: 0.52rem !important;
    font-weight: 700 !important;
  }

  html[data-device="iphone7"] .disk-temp {
    font-size: 0.52rem !important;
    font-weight: 700 !important;
  }

  html[data-device="iphone7"] .disk-meta {
    font-size: 0.45rem !important;
    font-weight: 650 !important;
  }

  html[data-device="iphone7"] .disk-meter {
    height: 4px !important;
  }

  html[data-device="iphone7"] .mem-duo {
    height: 100% !important;
    gap: 0.2rem !important;
  }

  html[data-device="iphone7"] .mem-pane-label {
    font-size: 0.55rem !important;
    letter-spacing: 0.1em !important;
  }

  html[data-device="iphone7"] .ram-pct {
    font-size: clamp(1.05rem, 5vh, 1.35rem) !important;
  }

  html[data-device="iphone7"] .ram-unit {
    font-size: 0.5rem !important;
  }

  html[data-device="iphone7"] .ram-column,
  html[data-device="iphone7"] .vram-column {
    min-height: 0 !important;
    width: min(28px, 70%) !important;
    border-radius: 8px !important;
  }

  html[data-device="iphone7"] .ram-text {
    font-size: clamp(0.38rem, 26cqw, 0.58rem) !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    padding: 0.12rem 0.04rem !important;
    white-space: nowrap !important;
    letter-spacing: -0.02em !important;
    position: absolute !important;
    inset: auto !important;
    left: 50% !important;
    top: 50% !important;
    width: max-content !important;
    max-width: none !important;
    height: auto !important;
    transform: translate(-50%, -50%) rotate(-90deg) !important;
    transform-origin: center center !important;
  }
}

@media (orientation: portrait) {
  html[data-device="iphone7"],
  html[data-device="iphone7"] body {
    overflow: auto !important;
    height: 100% !important;
  }

  html[data-device="iphone7"] .stage {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto !important;
    grid-template-areas:
      "cpu gpu"
      "ram ram"
      "disks disks"
      "fans fans" !important;
    gap: 0.35rem !important;
    height: auto !important;
  }

  html[data-device="iphone7"] .mod {
    border-radius: 10px !important;
    padding: 0.35rem 0.4rem !important;
  }

  html[data-device="iphone7"] .spark {
    display: block !important;
    height: 28px !important;
  }

  html[data-device="iphone7"] .cpu .gauge,
  html[data-device="iphone7"] .gpu .gauge {
    width: min(38%, 72px) !important;
  }

  html[data-device="iphone7"] .inline-fan {
    flex: 0 0 64px !important;
    width: 64px !important;
  }

  html[data-device="iphone7"] .disk-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
  }

  html[data-device="iphone7"] .disk {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
  }
}

/* ===== DarkDeck theme skin ===== */
html[data-theme="darkdeck"] .void,
html[data-theme="darkdeck"] .aurora,
html[data-theme="darkdeck"] .scan {
  display: none !important;
}

html[data-theme="darkdeck"] body {
  background: #0a0e14 !important;
  font-family: "JetBrains Mono", "Chakra Petch", sans-serif !important;
}

html[data-theme="darkdeck"] .mod {
  border: 1px solid var(--line) !important;
  border-radius: 2px !important;
  background: #0d1219 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  position: relative;
}

html[data-theme="darkdeck"] .mod::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  z-index: 2;
  background:
    linear-gradient(var(--dd-corner), var(--dd-corner)) 0 0 / 10px 1.5px no-repeat,
    linear-gradient(var(--dd-corner), var(--dd-corner)) 0 0 / 1.5px 10px no-repeat,
    linear-gradient(var(--dd-corner), var(--dd-corner)) 100% 0 / 10px 1.5px no-repeat,
    linear-gradient(var(--dd-corner), var(--dd-corner)) 100% 0 / 1.5px 10px no-repeat,
    linear-gradient(var(--dd-corner), var(--dd-corner)) 0 100% / 10px 1.5px no-repeat,
    linear-gradient(var(--dd-corner), var(--dd-corner)) 0 100% / 1.5px 10px no-repeat,
    linear-gradient(var(--dd-corner), var(--dd-corner)) 100% 100% / 10px 1.5px no-repeat,
    linear-gradient(var(--dd-corner), var(--dd-corner)) 100% 100% / 1.5px 10px no-repeat;
}

html[data-theme="darkdeck"] .disk,
html[data-theme="darkdeck"] .fan-card,
html[data-theme="darkdeck"] .fan-row .fan-card-h {
  border: 1px solid var(--line) !important;
  border-radius: 2px !important;
  background: #10161f !important;
  box-shadow: none !important;
}

html[data-theme="darkdeck"] .cpu .gauge-num,
html[data-theme="darkdeck"] .gpu .gauge-num,
html[data-theme="darkdeck"] .accent-cpu,
html[data-theme="darkdeck"] .accent-gpu,
html[data-theme="darkdeck"] .temp,
html[data-theme="darkdeck"] .ram-pct {
  color: var(--dd-accent) !important;
  text-shadow: none !important;
  animation: none !important;
}

html[data-theme="darkdeck"] .g-value {
  stroke: var(--dd-accent) !important;
  filter: none !important;
}

html[data-theme="darkdeck"] #cpu-ring,
html[data-theme="darkdeck"] #gpu-ring {
  stroke: var(--dd-accent) !important;
}

html[data-theme="darkdeck"] .g-track {
  stroke: rgba(255, 255, 255, 0.12) !important;
}

html[data-theme="darkdeck"] .thermo i,
html[data-theme="darkdeck"] .meter i,
html[data-theme="darkdeck"] .disk-meter i,
html[data-theme="darkdeck"] .ram-fill {
  background: linear-gradient(90deg, var(--dd-bar), #5aa3f0) !important;
  box-shadow: none !important;
}

html[data-theme="darkdeck"] .vram-fill {
  background: linear-gradient(180deg, #5aa3f0, var(--dd-bar) 45%, #2a6bb8) !important;
  box-shadow: none !important;
}

html[data-theme="darkdeck"] .ram-column {
  border-color: rgba(62, 143, 229, 0.45) !important;
  background: #10161f !important;
  border-radius: 2px !important;
}

html[data-theme="darkdeck"] .vram-column {
  border-color: rgba(247, 189, 113, 0.4) !important;
}

html[data-theme="darkdeck"] .mod-head,
html[data-theme="darkdeck"] .m-label,
html[data-theme="darkdeck"] .mem-pane-label,
html[data-theme="darkdeck"] .disk-name,
html[data-theme="darkdeck"] .fan-name,
html[data-theme="darkdeck"] .title {
  color: #cccccc !important;
  letter-spacing: 0.08em !important;
}

html[data-theme="darkdeck"] .m-value,
html[data-theme="darkdeck"] .clock,
html[data-theme="darkdeck"] .fan-rpm,
html[data-theme="darkdeck"] .disk-meta,
html[data-theme="darkdeck"] .ram-text {
  color: #e8e8e8 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85) !important;
}

html[data-theme="darkdeck"] .theme-btn,
html[data-theme="darkdeck"] .fs-btn,
html[data-theme="darkdeck"] .pill {
  border: 1px solid var(--line) !important;
  border-radius: 2px !important;
  background: #10161f !important;
  color: #cccccc !important;
  box-shadow: none !important;
}

html[data-theme="darkdeck"] .pill i {
  background: #6dffb0 !important;
  box-shadow: none !important;
}

html[data-theme="darkdeck"] .fan-svg,
html[data-theme="darkdeck"] .fan-card.gpu-fan .fan-svg {
  color: var(--dd-accent) !important;
  filter: none !important;
}

html[data-theme="darkdeck"] .fan-card:not(.fan-idle) .fan-frame,
html[data-theme="darkdeck"] .fan-card:not(.fan-idle) .fan-blades path,
html[data-theme="darkdeck"] .fan-card:not(.fan-idle) .fan-hub {
  fill: #0a0a0a !important;
}

html[data-theme="darkdeck"] .meter i::after,
html[data-theme="darkdeck"] .disk-meter i::after,
html[data-theme="darkdeck"] .bar-fill::after {
  display: none !important;
}

/* iPhone 7 + DarkDeck: corner brackets malo manji */
html[data-theme="darkdeck"][data-device="iphone7"] .mod::before {
  background:
    linear-gradient(var(--dd-corner), var(--dd-corner)) 0 0 / 7px 1.5px no-repeat,
    linear-gradient(var(--dd-corner), var(--dd-corner)) 0 0 / 1.5px 7px no-repeat,
    linear-gradient(var(--dd-corner), var(--dd-corner)) 100% 0 / 7px 1.5px no-repeat,
    linear-gradient(var(--dd-corner), var(--dd-corner)) 100% 0 / 1.5px 7px no-repeat,
    linear-gradient(var(--dd-corner), var(--dd-corner)) 0 100% / 7px 1.5px no-repeat,
    linear-gradient(var(--dd-corner), var(--dd-corner)) 0 100% / 1.5px 7px no-repeat,
    linear-gradient(var(--dd-corner), var(--dd-corner)) 100% 100% / 7px 1.5px no-repeat,
    linear-gradient(var(--dd-corner), var(--dd-corner)) 100% 100% / 1.5px 7px no-repeat;
}
