/* A working copy of the app's popover. Sizes, colours and spacing follow Sources/PopoverView.swift and
   Sources/Components.swift at 1 CSS px per point, so it reads at the app's real size. */
.pop {
  --cpu: #5C94FF;
  --gpu: #A878FF;
  --mem: #33CCB3;
  --disk: rgba(255, 255, 255, .62);
  --awake: #FFB347;
  --warn: #FFC740;
  --p-ink: rgba(255, 255, 255, .88);
  --p-2: rgba(255, 255, 255, .62);
  --on-tint: rgba(0, 0, 0, .82);
  --surf: rgba(255, 255, 255, .055);
  position: relative; display: flex; flex-direction: column; gap: 14px; width: 348px; padding: 14px;
  border-radius: 13px; background: #2C2C2E; color: var(--p-ink);
  box-shadow: 0 24px 60px rgba(20, 24, 40, .22), 0 0 0 .5px rgba(0, 0, 0, .3), inset 0 0 0 .5px rgba(255, 255, 255, .1);
  font: 11px/1.3 var(--text); font-variant-numeric: tabular-nums; text-align: left;
  -webkit-user-select: none; user-select: none;
}
.pop [hidden] { display: none !important; }
.pop ::selection { background: rgba(92, 148, 255, .4); }
/* Zero specificity, so each control's own class sets its padding and fill. */
:where(.pop button) {
  margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: inherit;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
:where(.pop button):active { opacity: .75; }
.pop :focus-visible { outline: 2px solid var(--cpu); outline-offset: 1px; }
.ic { flex: none; width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.p-stack { display: flex; flex-direction: column; gap: 8px; }
.card { border-radius: 14px; background: var(--surf); }
.sub2 { display: block; font-size: 10.5px; color: var(--p-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.p-head { display: flex; align-items: center; gap: 10px; padding: 0 2px; }
.glyph {
  flex: none; display: flex; align-items: flex-end; justify-content: center; gap: 2.25px; width: 30px; height: 30px; padding-bottom: 6px;
  border-radius: 8.1px; background: linear-gradient(#212645, #0A0D17); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .1);
}
.glyph i { width: 4.5px; border-radius: 3px; }
.glyph i:nth-child(1) { height: 10.8px; background: linear-gradient(#6BDBFF, var(--cpu)); }
.glyph i:nth-child(2) { height: 16.8px; background: linear-gradient(#FF85CC, var(--gpu)); }
.glyph i:nth-child(3) { height: 13.5px; background: linear-gradient(#9EFFB3, var(--mem)); }
.p-name { min-width: 0; }
.p-name b { display: block; font: 600 14px/1.2 var(--display); }
.p-up { display: flex; align-items: center; gap: 5px; margin-left: auto; font-size: 10.5px; font-weight: 500; color: var(--p-2); }
.p-up .ic { font-size: 12px; }

.banner {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px;
  background: rgba(255, 199, 64, .13); box-shadow: inset 0 0 0 .5px rgba(255, 199, 64, .35);
}
.b-ic { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--on-tint); background: linear-gradient(#FFD878, var(--warn)); }
.b-ic .ic { font-size: 18px; }
.b-text { flex: 1; min-width: 0; }
.b-text b, .t-text b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--p-2); }
.x .ic { font-size: 10px; stroke-width: 2.2; }

.pill {
  flex: none; display: inline-flex; align-items: center; justify-content: center; height: 24px; padding: 0 8px; border-radius: 12px;
  background: rgba(255, 255, 255, .06); color: var(--p-2); font: 600 11px/1 var(--display);
  transition: transform .15s, opacity .15s, background-color .2s, color .2s;
}
.pop .pill:active { transform: scale(.96); opacity: .7; }
.pill.prom { padding: 0 12px; background: rgba(255, 255, 255, .11); color: var(--p-ink); }
.pill[aria-pressed="true"] { background: linear-gradient(#FFC877, var(--awake)); color: var(--on-tint); }
.pill .ic { font-size: 13px; stroke-width: 1.8; }

.meters { padding: 6px 8px; }
.m-row { display: flex; align-items: flex-start; gap: 4px; }
.m-col {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 10px;
  white-space: nowrap; transition: background-color .2s;
}
.pop .m-col { text-align: center; }
.m-col:hover { background: rgba(255, 255, 255, .035); }
.m-col[aria-pressed="true"] { background: rgba(255, 255, 255, .07); }
.m-lbl { font-size: 10px; font-weight: 600; letter-spacing: .6px; color: var(--p-2); }
.meter { position: relative; width: 20px; height: 72px; margin-top: 8px; overflow: hidden; border-radius: 10px; background: color-mix(in srgb, var(--c) 16%, transparent); }
.meter i {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--f) * 100%);
  /* A rounded top keeps the fill concentric with the capsule near 100%. */
  border-radius: min(10px, calc(var(--f) * 36px)) min(10px, calc(var(--f) * 36px)) 0 0;
  background: linear-gradient(var(--c), color-mix(in srgb, var(--c) 72%, transparent));
  transition: height .25s ease-out;
}
.m-pct { display: flex; align-items: baseline; gap: 1px; margin-top: 8px; font: 600 21px/1.1 var(--display); }
.m-pct small { font: 600 12px var(--display); color: var(--p-2); }
.m-amt { margin-top: 1px; font-weight: 500; }
.m-ctx { font-size: 10.5px; color: var(--p-2); }

.t-apps { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 10px 6px 4px; border-top: 1px solid rgba(255, 255, 255, .1); }
.t-apps[hidden] { display: none; }
.t-head { display: flex; align-items: center; gap: 6px; height: 18px; font-size: 10px; font-weight: 600; letter-spacing: .6px; color: var(--p-2); }
.t-views { display: flex; gap: 6px; margin-left: auto; }
.t-views[hidden], .t-label[hidden] { display: none; }
.t-label { margin-left: auto; }
.t-views button { padding: 2px 6px; border-radius: 9px; color: var(--p-2); }
.t-views button[aria-pressed="true"] { background: rgba(255, 255, 255, .1); color: var(--p-ink); }
.t-row { display: flex; flex-direction: column; gap: 4px; }
.t-line { display: flex; align-items: center; gap: 8px; height: 16px; font-weight: 500; white-space: nowrap; }
.t-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.t-name.dim { color: var(--p-2); }
/* Laid out but transparent until hover or focus, so keyboard and screen reader users can still reach it. */
.t-quit { height: 16px; padding: 0 7px; border-radius: 8px; background: rgba(255, 255, 255, .09); font: 600 10px/16px var(--display); opacity: 0; pointer-events: none; }
.t-row:hover .t-quit, .t-row:focus-within .t-quit { opacity: 1; pointer-events: auto; }
/* After a quit the next row slides under the pointer; it must not show a Quit button mid double-click. */
.t-apps.just-quit .t-row:hover .t-quit:not(:focus-visible) { opacity: 0; pointer-events: none; }
@media (hover: none) { .t-quit { opacity: 1; pointer-events: auto; } }
.t-bar { height: 3px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, .08); }
.t-bar i { display: block; width: calc(var(--v, 0) * 100%); height: 100%; border-radius: 2px; background: var(--tint); transition: width .25s ease-out; }
.t-foot { font-size: 10px; color: var(--p-2); }

.activity { padding: 12px; }
.a-legend { display: flex; align-items: center; gap: 8px; height: 14px; font-size: 10.5px; font-weight: 500; white-space: nowrap; }
.key { display: inline-flex; align-items: center; gap: 4px; }
.key::before { content: ""; width: 9px; height: 3px; border-radius: 2px; background: var(--c); }
.a-legend .dim { color: var(--p-2); }
.rates { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.rates > span { display: inline-flex; align-items: center; gap: 2px; }
.rates .ic { color: var(--p-2); font-size: 13px; }
.rates .arw { font-size: 9px; stroke-width: 2.2; }
.chart { display: block; width: 100%; height: 44px; margin-top: 8px; overflow: hidden; }
.chart .grid { stroke: rgba(255, 255, 255, .1); stroke-width: .5; stroke-dasharray: 2 3; }
.chart .base { stroke: rgba(255, 255, 255, .14); stroke-width: .5; }
.chart .area { fill: rgba(92, 148, 255, .12); }
.chart .ln { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .cpu { stroke: var(--cpu); }
.chart .gpu { stroke: var(--gpu); }
.cores { display: grid; grid-template-columns: repeat(4, 1fr) 4px repeat(10, 1fr); column-gap: 2px; row-gap: 4px; margin-top: 12px; }
.core { position: relative; height: 14px; overflow: hidden; border-radius: 2px; background: rgba(92, 148, 255, .16); }
.core i { position: absolute; left: 0; right: 0; bottom: 0; height: max(2px, calc(var(--l, 0) * 14px)); border-radius: 2px; background: var(--cpu); transition: height .25s ease-out; }
.cores .lbl { grid-row: 2; font-size: 9.5px; font-weight: 500; line-height: 13px; color: var(--p-2); white-space: nowrap; }
.cores .lbl.e { grid-column: 1 / span 4; }
.cores .lbl.p { grid-column: 6 / -1; }

.ptile { display: flex; align-items: center; gap: 10px; padding: 10px; }
.a-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.t-text { flex: 1; min-width: 0; }
.badge {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .75);
  transition: background-color .25s, box-shadow .25s, color .25s;
}
.badge .ic { font-size: 16px; }
.badge .on, .awake.on .badge .off { display: none; }
.awake.on .badge .on { display: block; }
.awake.on .badge { background: linear-gradient(#FFC877, var(--awake)); color: var(--on-tint); box-shadow: 0 2px 6px rgba(255, 179, 71, .45); }
.pills { flex: none; display: flex; gap: 3px; }

.p-foot { display: flex; align-items: center; gap: 12px; padding: 0 4px; font-weight: 500; color: var(--p-2); }
.p-foot .ic { font-size: 14px; }
.p-foot span:first-of-type { margin-left: auto; }

/* The keyboard lock covers the whole window, as the app's overlay covers the whole screen. */
.lock {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; color: #fff; text-align: center;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .06), transparent 520px), linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .78));
  -webkit-backdrop-filter: blur(28px) saturate(.8); backdrop-filter: blur(28px) saturate(.8);
  opacity: 0; transition: opacity .3s ease-out;
}
.lock[hidden] { display: none; }
.lock.in { opacity: 1; }
.l-body { display: flex; flex-direction: column; align-items: center; }
.ring { position: relative; display: grid; place-items: center; width: 176px; height: 176px; }
.ring .r-svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .r-track { stroke: rgba(255, 255, 255, .1); }
.ring .r-fill { stroke: rgba(255, 255, 255, .9); stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.ring > .ic { font-size: 58px; stroke-width: .7; }
.lock h2 { margin-top: 36px; font: 600 34px/1.15 var(--display); letter-spacing: -.01em; }
.lock .l-sub { margin-top: 10px; font-size: 15px; color: rgba(255, 255, 255, .72); }
.stats { display: flex; align-items: center; margin-top: 30px; padding: 12px 0; border-radius: 30px; background: rgba(255, 255, 255, .07); }
.stats > div { width: 150px; }
.stats b { display: block; font: 600 20px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.stats span { display: block; margin-top: 2px; font-size: 9.5px; font-weight: 600; letter-spacing: .9px; color: rgba(255, 255, 255, .66); }
.stats hr { width: .5px; height: 30px; margin: 0; border: 0; background: rgba(255, 255, 255, .15); }
.hold {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; margin-top: 28px; padding: 0 24px; overflow: hidden;
  border: 0; border-radius: 20px; background: #fff; color: #000; font: 600 14px var(--display); cursor: pointer; touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.hold::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(0, 0, 0, .14); transition: width .2s ease-out; }
.hold.holding::before { width: 100%; transition: width .8s linear; }
.hold > * { position: relative; }
.hold .ic { font-size: 15px; }
.hold:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.l-hint { margin-top: 16px; font-size: 12px; color: rgba(255, 255, 255, .62); }

@media (prefers-reduced-motion: no-preference) {
  .l-body { transform: scale(.96); transition: transform .55s cubic-bezier(.34, 1.4, .64, 1); }
  .lock.in .l-body { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .meter i, .core i, .t-bar i, .ring .r-fill { transition: none; }
}
