/* paranoia.im web kit. Same tokens as the desktop UI (THEME_COLORS in core.h). Plain CSS, no build step.
   Change the look by editing the variables in :root. */

:root {
  --bg: #282828;
  --box: #1d1d1d;
  --tab-top: #323232;
  --tab-bot: #242424;
  --panel: #202020;
  --dark: #090909;
  --border: #3e3e3e;
  --border-hi: #585858;
  --field: #161616;
  --field-border: #0c0c0c;
  --hover: #2e2e2e;
  --text: #e2e2e2;
  --text-dim: #8a8a8a;
  --text-off: #545454;
  --accent: #b08ef4;
  --accent-lo: #6a5592;
  --accent-hi: #d6c2fa;
  --good: #62cc82;
  --warn: #e8b84c;
  --bad: #e85c5c;

  --font: Tahoma, "Segoe UI", Verdana, sans-serif;
  --font-mono: Consolas, "Cascadia Mono", "Courier New", monospace;
  --size: 12px;
  --line: 15px;
  --gap: 3px;
  --pad: 9px;
  --field-h: 18px;
  --button-h: 20px;
  --head-h: 22px;
  --tab-h: 24px;
  --width: 1100px;
}

* { box-sizing: border-box; }

html { background: var(--dark); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: var(--size)/var(--line) var(--font);
  color: var(--text);
  background: var(--dark);
  -webkit-font-smoothing: auto;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }
::selection { background: var(--accent-lo); color: var(--text); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 14px; font-weight: bold; }
h2, h3 { font-size: var(--size); font-weight: bold; }
.dim { color: var(--text-dim); }
.off { color: var(--text-off); }
.mono { font-family: var(--font-mono); }
.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.accent { color: var(--accent); }

/* page: an accent line at the very top, then the bars and the content */
.pm-top { height: 2px; background: linear-gradient(90deg, var(--accent-lo), var(--accent), var(--accent-lo)); }

.pm-bar {
  height: var(--head-h);
  display: flex;
  align-items: center;
  gap: var(--pad);
  padding: 0 var(--pad);
  background: linear-gradient(var(--tab-top), var(--tab-bot));
  border-bottom: 1px solid var(--border);
}
.pm-bar.foot { border-bottom: 0; border-top: 1px solid var(--border); margin-top: auto; color: var(--text-dim); }
.pm-brand { font-weight: bold; color: var(--text); }
.pm-brand b { color: var(--accent); font-weight: bold; }
.pm-bar .grow { flex: 1; }
.pm-bar a { color: var(--text-dim); }
.pm-bar a:hover, .pm-bar a.on { color: var(--text); }

.pm-crumbs { background: var(--box); border-bottom: 1px solid var(--border); padding: 4px var(--pad); color: var(--text-dim); }
.pm-crumbs span { color: var(--text-off); margin: 0 4px; }
.pm-crumbs b { color: var(--text); font-weight: normal; }

.pm-page { width: 100%; max-width: var(--width); margin: 0 auto; padding: 12px var(--pad) 24px; flex: 1; }
.pm-page.narrow { max-width: 420px; }

/* grid: columns of panels, one column on small screens */
.pm-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.pm-stack { display: flex; flex-direction: column; gap: 8px; }
.pm-row { display: flex; align-items: center; gap: var(--gap); }
.pm-row.wrap { flex-wrap: wrap; }
.pm-row .grow { flex: 1; }

/* panel: two nested outlines, a title band with an accent line on top */
.pm-panel {
  background: var(--box);
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1px var(--dark);
}
.pm-panel > .head {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--pad);
  height: var(--head-h);
  padding: 0 var(--pad);
  font-weight: bold;
  background: linear-gradient(var(--tab-top), var(--tab-bot));
  border-bottom: 1px solid var(--border);
}
.pm-panel > .head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--accent-lo); }
.pm-panel > .head .grow { flex: 1; }
.pm-panel > .head .dim { font-weight: normal; }
.pm-panel > .body { padding: var(--pad); display: flex; flex-direction: column; gap: var(--gap); background: var(--panel); margin: 1px; }
.pm-panel > .body.flush { padding: 0; gap: 0; }
.pm-panel.plain > .body { background: transparent; margin: 0; }

/* window: the inner box has its own 1px frame, like the menu */
.pm-window { background: var(--bg); border: 1px solid var(--border); box-shadow: 0 0 0 1px var(--dark), 0 8px 24px rgba(0,0,0,.5); }
.pm-window > .pm-panel { margin: 6px; }

/* key / value rows */
.pm-kv { display: flex; align-items: center; min-height: calc(var(--line) + 6px); padding: 2px var(--pad); gap: var(--pad); }
.pm-kv + .pm-kv { border-top: 1px solid var(--border); }
.pm-kv:nth-child(even) { background: rgba(255,255,255,.015); }
.pm-kv .k { width: 38%; color: var(--text-dim); flex: none; }
.pm-kv .v { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* status: a small square and a word, never a pill */
.pm-status { display: inline-flex; align-items: center; gap: 5px; }
.pm-status::before { content: ""; width: 7px; height: 7px; background: var(--text-off); }
.pm-status.good { color: var(--good); } .pm-status.good::before { background: var(--good); }
.pm-status.warn { color: var(--warn); } .pm-status.warn::before { background: var(--warn); }
.pm-status.bad { color: var(--bad); } .pm-status.bad::before { background: var(--bad); }

/* fields */
.pm-label { color: var(--text); margin-top: 3px; }
.pm-field, .pm-select, .pm-area {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--field-border);
  box-shadow: 0 0 0 1px var(--border);
  margin: 1px;
  width: calc(100% - 2px);
  padding: 0 6px;
  height: var(--field-h);
  outline: 0;
  border-radius: 0;
  transition: box-shadow .12s, border-color .12s;
}
.pm-area { height: auto; min-height: 90px; padding: 4px 6px; resize: vertical; line-height: var(--line); }
.pm-field:hover, .pm-select:hover, .pm-area:hover { box-shadow: 0 0 0 1px var(--border-hi); }
.pm-field:focus, .pm-select:focus, .pm-area:focus { box-shadow: 0 0 0 1px var(--accent-lo); border-color: var(--accent-lo); }
.pm-field::placeholder, .pm-area::placeholder { color: var(--text-off); }
.pm-field:disabled, .pm-select:disabled { color: var(--text-off); }
.pm-select {
  appearance: none;
  padding-right: 18px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 9px) 7px, calc(100% - 5px) 7px;
  background-size: 4px 4px;
  background-repeat: no-repeat;
}
.pm-hint { color: var(--text-dim); }

/* checkbox and radio: square box, accent fill when on */
.pm-check { display: flex; align-items: center; gap: 6px; cursor: pointer; min-height: var(--line); }
.pm-check input { appearance: none; margin: 0; width: 11px; height: 11px; flex: none; background: var(--field); border: 1px solid var(--field-border); box-shadow: 0 0 0 1px var(--border); cursor: pointer; transition: background .12s, box-shadow .12s; }
.pm-check:hover input { box-shadow: 0 0 0 1px var(--border-hi); }
.pm-check input:checked { background: var(--accent); box-shadow: 0 0 0 1px var(--accent-lo); }
.pm-check input:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* buttons */
.pm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--button-h);
  padding: 0 14px;
  font: inherit; color: var(--text);
  background: linear-gradient(var(--tab-top), var(--tab-bot));
  border: 1px solid var(--field-border);
  box-shadow: 0 0 0 1px var(--border);
  margin: 1px;
  cursor: pointer;
  border-radius: 0;
  transition: box-shadow .12s, filter .12s;
}
.pm-btn:hover { box-shadow: 0 0 0 1px var(--border-hi); filter: brightness(1.15); }
.pm-btn:active { filter: brightness(.9); }
.pm-btn:disabled { color: var(--text-off); cursor: default; filter: none; box-shadow: 0 0 0 1px var(--border); }
.pm-btn.block { display: flex; width: calc(100% - 2px); }
.pm-btn.primary { color: var(--dark); background: linear-gradient(var(--accent), var(--accent-lo)); box-shadow: 0 0 0 1px var(--accent-lo); }
.pm-btn.primary:hover { box-shadow: 0 0 0 1px var(--accent); }
.pm-btn.bad { color: var(--bad); }
.pm-btn.small { height: 16px; padding: 0 8px; }

/* tabs: a row of cells, the selected one is fused to the page below */
.pm-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.pm-tab {
  height: var(--tab-h); padding: 0 14px; display: flex; align-items: center;
  color: var(--text-dim); background: linear-gradient(var(--tab-top), var(--tab-bot));
  border: 1px solid var(--border); border-left-width: 0; cursor: pointer; margin-bottom: -1px;
  transition: color .12s, background .12s;
}
.pm-tab:first-child { border-left-width: 1px; }
.pm-tab:hover { color: var(--text); }
.pm-tab.on { color: var(--text); background: var(--panel); border-bottom-color: var(--panel); box-shadow: inset 0 1px 0 var(--accent-lo); }
.pm-tabs.fill .pm-tab { flex: 1; justify-content: center; }

/* notice: left bar in the status colour */
.pm-note { padding: 6px var(--pad); background: var(--field); border: 1px solid var(--border); border-left: 2px solid var(--accent-lo); color: var(--text-dim); }
.pm-note.good { border-left-color: var(--good); } .pm-note.warn { border-left-color: var(--warn); } .pm-note.bad { border-left-color: var(--bad); }

/* table */
.pm-table { width: 100%; border-collapse: collapse; }
.pm-table th { text-align: left; font-weight: bold; color: var(--text-dim); height: var(--head-h); padding: 0 var(--pad); background: linear-gradient(var(--tab-top), var(--tab-bot)); border-bottom: 1px solid var(--border); }
.pm-table td { padding: 3px var(--pad); border-bottom: 1px solid var(--border); }
.pm-table tr:last-child td { border-bottom: 0; }
.pm-table tbody tr:hover td { background: var(--hover); }

/* list rows with a square tile (products, devices, users) */
.pm-list { display: flex; flex-direction: column; gap: 3px; }
.pm-item { display: flex; align-items: center; gap: 10px; padding: 4px 8px; background: var(--panel); border: 1px solid var(--border); transition: border-color .12s, background .12s; }
.pm-item:hover { background: var(--hover); border-color: var(--border-hi); }
.pm-item.on { border-color: var(--accent-lo); box-shadow: inset 2px 0 0 var(--accent); }
.pm-tile { width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: bold; color: var(--text-dim); background: linear-gradient(color-mix(in srgb, var(--accent-lo) 30%, var(--panel)), var(--panel)); border: 1px solid var(--border); object-fit: cover; }
.pm-item .info { flex: 1; min-width: 0; }
.pm-item .info b { display: block; }
.pm-item .side { text-align: right; }

/* tag: square label */
.pm-tag { display: inline-block; padding: 0 5px; height: 14px; line-height: 12px; font-size: 11px; color: var(--text-dim); background: var(--field); border: 1px solid var(--border); }
.pm-tag.accent { color: var(--accent-hi); border-color: var(--accent-lo); }
.pm-tag.good { color: var(--good); } .pm-tag.warn { color: var(--warn); } .pm-tag.bad { color: var(--bad); }

/* code and key chips */
code, .pm-code { font-family: var(--font-mono); color: var(--accent-hi); background: var(--field); border: 1px solid var(--border); padding: 0 4px; }
.pm-pre { font-family: var(--font-mono); background: var(--field); border: 1px solid var(--border); padding: 6px var(--pad); overflow: auto; margin: 0; white-space: pre; color: var(--text); }
.pm-key { display: inline-block; min-width: 16px; text-align: center; padding: 0 4px; font-size: 11px; background: linear-gradient(var(--tab-top), var(--tab-bot)); border: 1px solid var(--border); border-bottom-color: var(--dark); }

/* progress and sliders */
.pm-bar-track { height: 10px; background: var(--field); border: 1px solid var(--field-border); box-shadow: 0 0 0 1px var(--border); margin: 1px; }
.pm-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-lo), var(--accent)); }
.pm-range { appearance: none; width: calc(100% - 2px); height: 10px; margin: 1px; background: var(--field); border: 1px solid var(--field-border); box-shadow: 0 0 0 1px var(--border); outline: 0; cursor: pointer; }
.pm-range::-webkit-slider-thumb { appearance: none; width: 8px; height: 10px; background: var(--accent); border: 0; }
.pm-range::-moz-range-thumb { width: 8px; height: 10px; background: var(--accent); border: 0; border-radius: 0; }

/* post, for forum style content: avatar tile, name, body */
.pm-post { display: flex; gap: 0; }
.pm-post .who { width: 150px; flex: none; padding: var(--pad); background: var(--box); border-right: 1px solid var(--border); text-align: center; display: flex; flex-direction: column; gap: 3px; align-items: center; }
.pm-post .who .pm-tile { width: 64px; height: 64px; font-size: 22px; }
.pm-post .what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pm-post .what .meta { padding: 3px var(--pad); color: var(--text-dim); border-bottom: 1px solid var(--border); background: var(--box); }
.pm-post .what .text { padding: var(--pad); line-height: 1.4; }

/* pager */
.pm-pager { display: flex; gap: 3px; }
.pm-pager a { min-width: 20px; height: 20px; padding: 0 6px; display: flex; align-items: center; justify-content: center; color: var(--text-dim); background: linear-gradient(var(--tab-top), var(--tab-bot)); border: 1px solid var(--border); }
.pm-pager a:hover { color: var(--text); border-color: var(--border-hi); }
.pm-pager a.on { color: var(--text); border-color: var(--accent-lo); box-shadow: inset 0 1px 0 var(--accent-lo); }

.pm-sep { height: 1px; background: var(--border); margin: 4px 0; }

@media (max-width: 640px) {
  .pm-post { flex-direction: column; }
  .pm-post .who { width: auto; flex-direction: row; border-right: 0; border-bottom: 1px solid var(--border); text-align: left; }
  .pm-post .who .pm-tile { width: 32px; height: 32px; font-size: 12px; }
  .pm-kv { flex-direction: column; align-items: flex-start; gap: 0; }
  .pm-kv .k { width: auto; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ==========================================================================================================================
   Menu components and motion. These rules sit on top of the base above and give the web the look of the desktop menu:
   gradient fields, the accent line with a passing shine, folders that open smoothly, a segmented control with a sliding
   highlight, a dropdown with a search box and fading edges, a strip you scroll sideways, skin tiles, key chips, toasts.
   Everything is CSS. Motion stops when the visitor asks for less of it (last rule of the file).
   ========================================================================================================================== */

:root {
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: .16s;
  --combo-top: #0f0f0f;
  --combo-bot: #232323;
  --tree-line: #585858;
  --rar-1: #4d6bff;
  --rar-2: #874dff;
  --rar-3: #d633e6;
  --rar-4: #eb4d4d;
  --rar-5: #ebc252;
}

/* fields: a sunken gradient, a dark line inside the border, like the desktop dropdown field */
.pm-field, .pm-select, .pm-area {
  background-color: var(--field);
  background-image: linear-gradient(var(--combo-top), var(--combo-bot));
  box-shadow: 0 0 0 1px var(--border), inset 0 0 0 1px rgba(0, 0, 0, .35);
}
.pm-select { background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%), linear-gradient(var(--combo-top), var(--combo-bot)); background-position: calc(100% - 9px) 7px, calc(100% - 5px) 7px, 0 0; background-size: 4px 4px, 4px 4px, 100% 100%; background-repeat: no-repeat; }
.pm-field:hover, .pm-select:hover, .pm-area:hover { box-shadow: 0 0 0 1px var(--border-hi), inset 0 0 0 1px rgba(0, 0, 0, .35); }
.pm-field:focus, .pm-select:focus, .pm-area:focus { box-shadow: 0 0 0 1px var(--accent-lo), inset 0 0 0 1px rgba(0, 0, 0, .35); }

/* buttons: the lit top edge, a press that sinks the gradient */
.pm-btn { position: relative; }
.pm-btn::before { content: ""; position: absolute; left: 1px; right: 1px; top: 0; height: 1px; background: rgba(255, 255, 255, .12); }
.pm-btn.primary::before { background: rgba(255, 255, 255, .35); }
.pm-btn:active { background: linear-gradient(var(--tab-bot), var(--field)); }
.pm-btn.primary:active { background: linear-gradient(var(--accent-lo), var(--accent-lo)); }

/* panels rise in one after the other; the accent line on top carries a slow shine */
.pm-panel { animation: pm-rise .42s var(--ease) both; animation-delay: calc(var(--n, 0) * 70ms); }
.pm-stack > .pm-panel:nth-child(2), .pm-grid > :nth-child(2) { --n: 1; }
.pm-stack > .pm-panel:nth-child(3), .pm-grid > :nth-child(3) { --n: 2; }
.pm-stack > .pm-panel:nth-child(4) { --n: 3; }
.pm-stack > .pm-panel:nth-child(5) { --n: 4; }
@keyframes pm-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.pm-panel > .head { overflow: hidden; }
.pm-panel > .head::before { height: 2px; background: linear-gradient(90deg, var(--accent-lo), var(--accent) 50%, var(--accent-lo)); }
.pm-panel > .head::after {
  content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 26%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .8), transparent);
  transform: translateX(-120%);
  animation: pm-shine 7s var(--ease) infinite;
}
@keyframes pm-shine { 0%, 58% { transform: translateX(-120%); } 100% { transform: translateX(480%); } }

/* a heading that wipes in */
.pm-reveal { animation: pm-wipe .9s var(--ease) both; }
@keyframes pm-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }

/* segmented control: radios, one highlight that slides to the choice (up to five choices) */
.pm-seg { position: relative; display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); height: calc(var(--field-h) + 2px); margin: 1px; background: linear-gradient(var(--combo-top), var(--combo-bot)); border: 1px solid var(--field-border); box-shadow: 0 0 0 1px var(--border); }
.pm-seg input { position: absolute; opacity: 0; pointer-events: none; }
.pm-seg label { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; color: var(--text-dim); cursor: pointer; transition: color var(--t); }
.pm-seg label:hover { color: var(--text); }
.pm-seg input:checked + label { color: var(--accent); }
.pm-seg::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: calc(100% / var(--n, 3)); background: linear-gradient(rgba(255, 255, 255, .08), rgba(0, 0, 0, .3)), var(--hover); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .24s var(--ease); }
.pm-seg:has(input:nth-of-type(2):checked) { --i: 1; }
.pm-seg:has(input:nth-of-type(3):checked) { --i: 2; }
.pm-seg:has(input:nth-of-type(4):checked) { --i: 3; }
.pm-seg:has(input:nth-of-type(5):checked) { --i: 4; }

/* tabs that share one accent line which slides to the chosen tab */
.pm-tabs.slide { position: relative; }
.pm-tabs.slide input { position: absolute; opacity: 0; pointer-events: none; }
.pm-tabs.slide .pm-tab { flex: 1; justify-content: center; }
.pm-tabs.slide input:checked + .pm-tab { color: var(--text); background: var(--panel); border-bottom-color: var(--panel); }
.pm-tabs.slide::after { content: ""; position: absolute; top: 0; left: 0; height: 2px; width: calc(100% / var(--n, 3)); background: var(--accent); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .26s var(--ease); }
.pm-tabs.slide:has(input:nth-of-type(2):checked) { --i: 1; }
.pm-tabs.slide:has(input:nth-of-type(3):checked) { --i: 2; }
.pm-tabs.slide:has(input:nth-of-type(4):checked) { --i: 3; }

/* checkbox with child rows behind a guide line (the tree of the menu) */
.pm-tree { position: relative; margin: 2px 0 2px 5px; padding-left: 14px; display: flex; flex-direction: column; gap: var(--gap); }
.pm-tree::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3px; background: linear-gradient(transparent, var(--tree-line) 14%, var(--border) 86%, transparent); box-shadow: -1px 0 #000, 1px 0 #000; transition: background .25s; }
.pm-tree.on::before { background: linear-gradient(transparent, var(--accent-hi) 14%, var(--accent-lo) 86%, transparent); }

/* folders of options: a header with an arrow, rows that open under a guide line (the theme window) */
.pm-folder { interpolate-size: allow-keywords; }
.pm-folder > summary { list-style: none; display: flex; align-items: center; min-height: calc(var(--line) + 3px); cursor: pointer; color: var(--text-dim); transition: color var(--t); }
.pm-folder > summary::-webkit-details-marker { display: none; }
.pm-folder > summary:hover, .pm-folder[open] > summary { color: var(--text); }
.pm-folder > summary::after { content: ""; margin-left: auto; margin-right: 4px; border: 4px solid transparent; border-top-color: var(--text-dim); border-bottom-width: 0; transition: transform .22s var(--ease); }
.pm-folder[open] > summary::after { transform: rotate(180deg); }
.pm-folder::details-content { block-size: 0; overflow: hidden; opacity: 0; transition: block-size .28s var(--ease), opacity .22s, content-visibility .28s allow-discrete; }
.pm-folder[open]::details-content { block-size: auto; opacity: 1; }
.pm-folder > .kids { position: relative; margin: 2px 0 4px 5px; padding-left: 14px; display: flex; flex-direction: column; gap: var(--gap); }
.pm-folder > .kids::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3px; background: linear-gradient(transparent, var(--accent-hi) 14%, var(--accent-lo) 86%, transparent); box-shadow: -1px 0 #000, 1px 0 #000; }

/* a colour row: name at the left, a square swatch at the right that opens the system picker */
.pm-color { display: flex; align-items: center; gap: 8px; min-height: var(--line); color: var(--text); }
.pm-color input[type=color] { appearance: none; margin: 0 0 0 auto; padding: 0; width: 34px; height: 12px; border: 0; background: none; cursor: pointer; }
.pm-color input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.pm-color input[type=color]::-webkit-color-swatch { border: 1px solid var(--field-border); box-shadow: 0 0 0 1px var(--border), inset 0 5px 0 rgba(255, 255, 255, .28); }
.pm-color input[type=color]::-moz-color-swatch { border: 1px solid var(--field-border); box-shadow: 0 0 0 1px var(--border), inset 0 5px 0 rgba(255, 255, 255, .28); }
.pm-color:hover input[type=color]::-webkit-color-swatch { box-shadow: 0 0 0 1px var(--border-hi), inset 0 5px 0 rgba(255, 255, 255, .28); }

/* dropdown: a field, a popup that unrolls, a search box, rows that fade at the cut edges */
@property --ft { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --fb { syntax: "<length>"; inherits: false; initial-value: 14px; }
.pm-dd { position: relative; }
.pm-dd > summary { list-style: none; display: flex; align-items: center; height: var(--field-h); margin: 1px; padding: 0 6px; cursor: pointer; color: var(--text); background: linear-gradient(var(--combo-top), var(--combo-bot)); border: 1px solid var(--field-border); box-shadow: 0 0 0 1px var(--border), inset 0 0 0 1px rgba(0, 0, 0, .35); transition: box-shadow var(--t); }
.pm-dd > summary::-webkit-details-marker { display: none; }
.pm-dd > summary::after { content: ""; margin-left: auto; width: 9px; height: 1px; background: var(--text-dim); }
.pm-dd > summary:hover { box-shadow: 0 0 0 1px var(--border-hi), inset 0 0 0 1px rgba(0, 0, 0, .35); }
.pm-dd[open] > summary { box-shadow: 0 0 0 1px var(--accent-lo), inset 0 0 0 1px rgba(0, 0, 0, .35); }
.pm-dd .pop { position: absolute; left: 1px; right: 1px; top: calc(100% + 1px); z-index: 20; background: linear-gradient(var(--combo-top), var(--combo-bot)); border: 1px solid var(--border-hi); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6), 0 8px 18px rgba(0, 0, 0, .5); animation: pm-unroll .2s var(--ease) both; }
@keyframes pm-unroll { from { clip-path: inset(0 0 100% 0); opacity: .3; } to { clip-path: inset(0); opacity: 1; } }
.pm-dd .search { display: flex; align-items: center; height: var(--field-h); margin: 4px; padding: 0 6px; gap: 6px; color: var(--text-off); background: var(--field); border: 1px solid var(--field-border); box-shadow: 0 0 0 1px var(--border); }
.pm-dd .search input { flex: 1; min-width: 0; font: inherit; color: var(--text); background: none; border: 0; outline: 0; padding: 0; }
.pm-dd .search::after { content: ""; width: 7px; height: 7px; border: 1px solid var(--accent); border-radius: 50%; }
.pm-dd .list { max-height: 138px; overflow: auto; scrollbar-width: none; mask-image: linear-gradient(transparent, #000 var(--ft), #000 calc(100% - var(--fb)), transparent); animation: pm-edge linear both; animation-timeline: scroll(self block); }
@keyframes pm-edge { 0% { --ft: 0px; --fb: 14px; } 8% { --ft: 14px; --fb: 14px; } 92% { --ft: 14px; --fb: 14px; } 100% { --ft: 14px; --fb: 0px; } }
.pm-dd .list > * { display: flex; align-items: center; height: 22px; padding: 0 8px; color: var(--text-dim); cursor: pointer; transition: color var(--t), background var(--t); }
.pm-dd .list > *:hover { color: var(--text); background: linear-gradient(rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); }
.pm-dd .list > .sel { color: var(--accent); }

/* key chips: the bind tags next to a control, lit while the bind is active */
.pm-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 5px; font-size: 11px; color: var(--text); background: linear-gradient(var(--combo-top), var(--combo-bot)); border: 1px solid var(--field-border); box-shadow: 0 0 0 1px var(--border), inset 0 0 0 1px rgba(0, 0, 0, .35); transition: color var(--t), box-shadow var(--t); }
.pm-chip.on { color: var(--accent); box-shadow: 0 0 0 1px var(--accent-lo), inset 0 0 0 1px rgba(0, 0, 0, .35); }
.pm-chips { display: flex; flex-wrap: wrap; gap: 4px; }
button.pm-chip { font: inherit; font-size: 11px; cursor: pointer; }
button.pm-chip:hover { box-shadow: 0 0 0 1px var(--border-hi), inset 0 0 0 1px rgba(0, 0, 0, .35); }

/* a strip you scroll sideways, its cut edges fade out (the weapon strip) */
.pm-strip { display: flex; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin: 1px; background: linear-gradient(var(--combo-top), var(--combo-bot)); border: 1px solid var(--field-border); box-shadow: 0 0 0 1px var(--border), inset 0 2px 0 var(--accent-lo); mask-image: linear-gradient(90deg, transparent, #000 26px, #000 calc(100% - 26px), transparent); }
.pm-strip > * { flex: none; width: 66px; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding-bottom: 5px; color: var(--text-off); font-size: 11px; cursor: pointer; scroll-snap-align: center; transition: color var(--t); }
.pm-strip > *::before { content: ""; width: 44px; height: 20px; background: currentColor; clip-path: var(--gun, polygon(0 40%, 8% 36%, 55% 36%, 60% 28%, 82% 28%, 84% 38%, 100% 40%, 98% 52%, 84% 54%, 70% 56%, 66% 90%, 56% 90%, 56% 58%, 20% 58%, 14% 50%, 0 50%)); transition: transform .25s var(--ease); }
.pm-strip > *:hover { color: var(--text-dim); }
.pm-strip > *:hover::before { transform: translateY(-2px); }
.pm-strip > .on { color: var(--accent); }
.pm-strip > .pistol { --gun: polygon(0 30%, 70% 30%, 72% 40%, 100% 40%, 100% 55%, 62% 58%, 56% 100%, 40% 100%, 44% 58%, 0 58%); }

/* skin tiles: a square, a coloured outline for the rarity, the item in its colour, the name under it */
.pm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 3px; }
.pm-skin { position: relative; aspect-ratio: 1; display: flex; align-items: flex-end; justify-content: center; padding: 0 4px 6px; color: var(--text-dim); font-size: 11px; text-align: center; cursor: pointer; background: linear-gradient(var(--box), var(--field)); border: 1px solid var(--rar, var(--border)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6); transition: color var(--t), filter var(--t), border-color var(--t); }
.pm-skin::before { content: ""; position: absolute; left: 14%; right: 14%; top: 20%; height: 36%; background: linear-gradient(var(--tint, #9a9a9a), color-mix(in srgb, var(--tint, #9a9a9a) 55%, #000)); clip-path: var(--gun, polygon(0 40%, 8% 36%, 55% 36%, 60% 28%, 82% 28%, 84% 38%, 100% 40%, 98% 52%, 84% 54%, 70% 56%, 66% 90%, 56% 90%, 56% 58%, 20% 58%, 14% 50%, 0 50%)); transition: transform .28s var(--ease); }
.pm-skin:hover { color: var(--text); filter: brightness(1.12); }
.pm-skin:hover::before { transform: scale(1.07) translateY(-2px); }
.pm-skin.on { border-color: var(--accent); color: var(--text); }
.pm-skin.on::after { content: ""; position: absolute; top: 5px; right: 5px; width: 4px; height: 4px; background: var(--accent); }
.pm-skin.add::before { display: none; }
.pm-skin.add { align-items: center; font-size: 22px; color: var(--text-off); }
.r1 { --rar: var(--rar-1); } .r2 { --rar: var(--rar-2); } .r3 { --rar: var(--rar-3); } .r4 { --rar: var(--rar-4); } .r5 { --rar: var(--rar-5); }

/* four numbered slots, like the sticker slots */
.pm-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.pm-slot { position: relative; height: 38px; display: flex; align-items: center; justify-content: center; color: var(--text-off); font-size: 16px; background: linear-gradient(var(--combo-top), var(--combo-bot)); border: 1px solid var(--field-border); box-shadow: 0 0 0 1px var(--border); cursor: pointer; transition: color var(--t), box-shadow var(--t); }
.pm-slot::before { content: attr(data-n); position: absolute; left: 5px; top: 3px; font-size: 11px; color: var(--text-off); }
.pm-slot:hover { color: var(--accent); box-shadow: 0 0 0 1px var(--border-hi); }
.pm-slot.on { box-shadow: 0 0 0 1px var(--accent); color: var(--accent); }

/* a window with a title band and a close mark, and the small widgets of the overlay */
.pm-win { background: var(--bg); border: 1px solid var(--border); box-shadow: 0 0 0 1px var(--dark), 0 8px 24px rgba(0, 0, 0, .5); }
.pm-win > .title { position: relative; display: flex; align-items: center; height: var(--head-h); padding: 0 var(--pad); font-weight: bold; background: linear-gradient(var(--tab-top), var(--tab-bot)); border-bottom: 1px solid var(--border); }
.pm-win > .title::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--accent-lo), var(--accent), var(--accent-lo)); }
.pm-win > .title .x { margin-left: auto; position: relative; width: 12px; height: 12px; cursor: pointer; }
.pm-win > .title .x::before, .pm-win > .title .x::after { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 2px; background: var(--text-dim); transition: background var(--t); }
.pm-win > .title .x::before { transform: rotate(45deg); }
.pm-win > .title .x::after { transform: rotate(-45deg); }
.pm-win > .title .x:hover::before, .pm-win > .title .x:hover::after { background: var(--text); }
.pm-win > .pm-panel { margin: 6px; }

.pm-hud { display: inline-block; min-width: 150px; padding: 5px; background: var(--bg); border: 1px solid var(--border); box-shadow: 0 0 0 1px var(--dark); }
.pm-hud > .in { position: relative; padding: 6px 9px; background: var(--panel); border: 1px solid var(--border); box-shadow: 0 0 0 1px var(--dark); }
.pm-hud > .in::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--accent-lo), var(--accent), var(--accent-lo)); }
.pm-hud b { display: block; margin-bottom: 3px; }
.pm-hud .r { display: flex; justify-content: space-between; gap: 14px; color: var(--text-dim); }
.pm-hud .r span:first-child { color: var(--text); }

.pm-keys { display: inline-grid; grid-template-columns: repeat(3, 36px); gap: 2px; padding: 5px; background: var(--bg); border: 1px solid var(--border); box-shadow: 0 0 0 1px var(--dark); }
.pm-keys i { display: flex; align-items: center; justify-content: center; height: 20px; font-style: normal; font-size: 11px; color: var(--text-dim); background: linear-gradient(var(--combo-top), var(--combo-bot)); border: 1px solid var(--field-border); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); transition: background .12s, color .12s; }
.pm-keys i.on { color: var(--text); background: linear-gradient(var(--accent), var(--accent-lo)); }
.pm-keys i.wide { grid-column: span 3; }

/* toasts: they slide in, a thin bar runs down, they slide out (add class stay to keep one) */
.pm-toasts { position: fixed; right: 12px; bottom: 12px; z-index: 50; display: flex; flex-direction: column; gap: 4px; }
.pm-toast { position: relative; min-width: 230px; padding: 7px 10px 9px; background: var(--bg); border: 1px solid var(--border); box-shadow: 0 0 0 1px var(--dark); animation: pm-in .32s var(--ease) both, pm-out .3s var(--ease) 5s forwards; }
.pm-toast::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--accent); }
.pm-toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%; background: var(--accent-lo); transform-origin: left; animation: pm-life 5s linear both; }
.pm-toast.stay { animation: pm-in .32s var(--ease) both; }
.pm-toast.stay::after { animation: none; }
.pm-toast.good::before { background: var(--good); } .pm-toast.warn::before { background: var(--warn); } .pm-toast.bad::before { background: var(--bad); }
.pm-toast b { display: block; }
@keyframes pm-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes pm-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes pm-life { to { transform: scaleX(0); } }

/* a tooltip from data-tip: it waits a moment, then rises into place */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translate(-50%, 4px); padding: 3px 7px; white-space: nowrap; font-size: 11px; color: var(--text); background: var(--box); border: 1px solid var(--border-hi); box-shadow: 0 0 0 1px var(--dark); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 30; }
[data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .35s; }

/* progress that is not known yet: a band runs along the track */
.pm-bar-track { overflow: hidden; }
.pm-bar-fill.run { width: 38%; animation: pm-run 1.7s var(--ease) infinite; }
@keyframes pm-run { from { transform: translateX(-100%); } to { transform: translateX(270%); } }

/* a row with a square tile that lights its left edge when you point at it (boards, threads, files) */
.pm-line { position: relative; display: flex; align-items: center; gap: 10px; padding: 5px 9px 5px 11px; background: var(--panel); border-bottom: 1px solid var(--border); transition: background var(--t); animation: pm-rise .4s var(--ease) both; animation-delay: calc(var(--n, 0) * 45ms); }
.pm-line::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); transform: scaleY(0); transition: transform .2s var(--ease); }
.pm-line:hover { background: var(--hover); }
.pm-line:hover::before { transform: scaleY(1); }
.pm-line:last-child { border-bottom: 0; }
.pm-line .info { flex: 1; min-width: 0; }
.pm-line .info b { display: block; font-weight: bold; }
.pm-line .num { width: 70px; text-align: center; flex: none; }
.pm-line .last { width: 150px; flex: none; text-align: right; }
.pm-line.head { background: linear-gradient(var(--tab-top), var(--tab-bot)); color: var(--text-dim); font-weight: bold; min-height: var(--head-h); animation: none; }
.pm-line.head::before { display: none; }
.pm-line.new .info b::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 6px; background: var(--accent); }

/* quotes, signatures, reactions and the editor toolbar of a forum */
.pm-quote { margin: 4px 0; padding: 5px 9px; color: var(--text-dim); background: var(--field); border: 1px solid var(--border); border-left: 2px solid var(--accent-lo); }
.pm-quote b { color: var(--text); }
.pm-sig { margin-top: 8px; padding-top: 5px; border-top: 1px solid var(--border); color: var(--text-off); }
.pm-bar2 { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.pm-tool { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; font: inherit; color: var(--text-dim); background: linear-gradient(var(--tab-top), var(--tab-bot)); border: 1px solid var(--field-border); box-shadow: 0 0 0 1px var(--border); cursor: pointer; transition: color var(--t), box-shadow var(--t); }
.pm-tool:hover { color: var(--text); box-shadow: 0 0 0 1px var(--border-hi); }
.pm-split { width: 1px; height: 14px; background: var(--border); margin: 0 3px; }
.pm-layout { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) 250px; align-items: start; }

@media (max-width: 800px) {
  .pm-layout { grid-template-columns: 1fr; }
  .pm-line .num, .pm-line .last { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .pm-dd .list { mask-image: none; }
}
