/*
 * The operator console. The studio's look (launcher/BRAND.md, launcher/brand/palette.json): a dark room
 * lit by one torch. Flat colour, hard edges, ONLY palette colours. No gradient, no blur, no glow, no
 * backdrop filter, no orange, gold, red, green or blue. Ember rose is the eye: the attention dot and a
 * failure's outline; it is never text and never a fill. State is never carried by colour alone: a mark
 * always sits beside a word.
 *
 * Series in a chart are told apart without a rainbow: by lightness (ivory, light violet, violet), by
 * line style (solid, dashed, dotted), by marker shape, by direct labels and by position.
 *
 * Logical properties throughout, so right to left is the same layout mirrored.
 * Fonts are the studio's own, served from this server (Cairo for reading, both scripts; IM Fell English
 * SC for Latin titles; Aref Ruqaa for Arabic titles), with system fonts behind them.
 * Checked by `node launcher/brand/offpalette.mjs` (test/static.test.mjs runs it when it is present).
 */

@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/admin/static/Cairo-400-900-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/admin/static/Cairo-400-900-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Aref Ruqaa";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/admin/static/ArefRuqaa-700-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "IM Fell English SC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/admin/static/IMFellEnglishSC-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --night: #15121b;
  --surface0: #1c1824;
  --surface2: #24202e;
  --card: #211c2b;
  --line: #2c2737;
  --text: #e7e2ee;
  --muted: #a69fb4;
  --disabled: #6f677e;
  --violet: #7a56c8;
  --lavender: #a98be0;
  --press: #4b3480;
  --shadow: #0c0a10;
  --rose: #e07a6b;
  --white: #ffffff;
  --ivory: #ece7f0;
  --wash-deep: #6a4bb0;
  --gouge: #8d6ad6;
  --font: "Cairo", "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
  --font-title-en: "IM Fell English SC", Georgia, "Times New Roman", serif;
  --font-title-ar: "Aref Ruqaa", "Cairo", Tahoma, serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  --r-btn: 10px;
  --r-input: 8px;
  --r-card: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 15px;
  background: var(--night);
}

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  min-height: 100vh;
}

html[lang="ar"] body {
  line-height: 1.75;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  line-height: 1.3;
}

p {
  margin: 0.4rem 0;
}

a {
  color: var(--lavender);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--lavender);
  outline-offset: 2px;
}

.noscript {
  padding: 1rem;
}

.mono {
  font-family: var(--mono);
  font-size: 0.9em;
}

bdi {
  unicode-bidi: isolate;
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  inset-block-start: 0.5rem;
  inset-inline-start: 0.5rem;
  z-index: 80;
}

.skip:not(:focus) {
  width: 1px;
  height: 1px;
  padding: 0;
  min-height: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
}

.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

[dir="rtl"] .icon.flip {
  transform: scaleX(-1);
}

/* ---------------------------------------------------------------- shell */

.app {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  background: var(--surface0);
  border-inline-end: 2px solid var(--line);
  padding: 1.1rem 0.8rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  inset-block-start: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}

.body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-inline: 0.4rem;
}

.mark {
  flex: none;
}

.mark-iris {
  fill: var(--violet);
}

.mark-pupil {
  fill: var(--night);
}

.wordmark {
  font-family: var(--font-title-en);
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  line-height: 1.1;
}

html[lang="ar"] .wordmark {
  font-family: var(--font-title-ar);
  font-weight: 700;
  letter-spacing: 0;
  font-size: 1.45rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.2;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nav-title {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding-inline: 0.7rem;
  margin-bottom: 0.2rem;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--lavender);
  text-decoration: none;
  border: 2px solid transparent;
  border-inline-start: 4px solid transparent;
  border-radius: 6px;
  padding: 0.42rem 0.7rem;
  transition: background-color 180ms ease-out;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.nav-item[aria-current="page"] {
  background: var(--surface2);
  color: var(--text);
  font-weight: 650;
  border-color: var(--line);
  border-inline-start-color: var(--lavender);
}

.nav-lock {
  color: var(--muted);
  width: 15px;
  height: 15px;
}

.nav-game-name {
  margin: 0 0 0.4rem;
  padding-inline: 0.7rem;
  color: var(--text);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.nav-back {
  justify-content: flex-start;
  color: var(--muted);
}

.nav-back-icon {
  width: 15px;
  height: 15px;
}

html[dir="rtl"] .nav-back-icon {
  transform: scaleX(-1);
}

.scope-slot {
  display: flex;
  align-items: center;
  min-inline-size: 0;
}

.scope-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-inline-size: 0;
}

.scope-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.scope-select {
  min-inline-size: 9rem;
  max-inline-size: 16rem;
  color: var(--text);
  background: var(--surface0);
  border: 2px solid var(--line);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  transition: background-color 180ms ease-out;
}

.scope-select:hover {
  background: var(--surface2);
}

.scope-select:focus-visible {
  outline: 2px solid var(--lavender);
  outline-offset: 2px;
}

.top {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.5rem;
  border-bottom: 2px solid var(--line);
  background: var(--night);
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
}

.view-title {
  font-family: var(--font-title-en);
  font-weight: 400;
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  margin-inline-end: auto;
}

html[lang="ar"] .view-title {
  font-family: var(--font-title-ar);
  font-weight: 700;
  letter-spacing: 0;
  font-size: 1.85rem;
}

.top-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
}

.top .nav-toggle {
  display: none;
}

.refresh {
  gap: 0.4rem;
  color: var(--muted);
}

.refresh.stale {
  color: var(--text);
  border-color: var(--rose);
}

.alert-count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border: 2px solid var(--line);
  border-radius: var(--r-btn);
  color: var(--muted);
  text-decoration: none;
  min-height: 2.4rem;
}

.alert-count.has {
  color: var(--text);
  border-color: var(--rose);
  font-weight: 650;
}

.alert-count.hidden-count {
  visibility: hidden;
}

.user-menu {
  position: relative;
}

.user-btn {
  gap: 0.4rem;
}

.menu {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 15rem;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 8px 8px 0 var(--shadow);
  padding: 0.4rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.menu-head {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
}

.menu-item {
  display: block;
  width: 100%;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.main {
  padding: 1.25rem 1.5rem 3.5rem;
  min-width: 0;
  max-width: 96rem;
  width: 100%;
}

.main:focus {
  outline: none;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.view-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.5rem;
  background: var(--surface2);
  border-inline-start: 4px solid var(--rose);
}

.toasts {
  position: fixed;
  inset-block-end: 1rem;
  inset-inline-start: 1rem;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(26rem, calc(100vw - 2rem));
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--card);
  border: 2px solid var(--lavender);
  border-radius: var(--r-card);
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 0.6rem 0.9rem;
}

.toast-bad {
  border-color: var(--rose);
}

/* ---------------------------------------------------------------- gate */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.gate-card {
  width: min(27rem, 100%);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 8px 8px 0 var(--shadow);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gate-card h1 {
  font-family: var(--font-title-en);
  font-weight: 400;
  font-size: 2rem;
  letter-spacing: 0.04em;
}

html[lang="ar"] .gate-card h1 {
  font-family: var(--font-title-ar);
  font-weight: 700;
  letter-spacing: 0;
  font-size: 2.1rem;
}

.gate-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- cards, tiles */

.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r-card);
  padding: 1rem 1.1rem 1.1rem;
  min-width: 0;
}

.panel-plain {
  border: 0;
  background: transparent;
  padding: 0;
}

.panel-head,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.card-title {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

.panel-head .card-title {
  margin-bottom: 0;
}

.section-title {
  font-size: 1.15rem;
}

.sub-title {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 1rem 0 0.4rem;
}

.sub-title.strong {
  color: var(--text);
  font-size: 1rem;
}

.cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  gap: 0.75rem;
}

.tiles-3 {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.tile {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r-card);
  padding: 0.8rem 1rem;
  min-width: 0;
}

.tile-hero {
  grid-column: span 2;
  border-color: var(--violet);
}

.tile-bad {
  border-color: var(--rose);
}

.tile-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.tile-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
}

.tile-hero .tile-value {
  font-size: 3rem;
  line-height: 1.1;
}

.tile-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

.tile .spark {
  display: block;
  margin-top: 0.4rem;
  max-width: 100%;
}

.note {
  color: var(--muted);
}

.note.warn {
  color: var(--text);
  border-inline-start: 4px solid var(--rose);
  padding-inline-start: 0.7rem;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.2rem 0 0;
}

.count {
  color: var(--muted);
  margin: 0.4rem 0;
}

.lead-line {
  margin: 0 0 0.5rem;
}

.links-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.6rem 0;
}

.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.attribution {
  color: var(--muted);
  font-size: 0.85rem;
}

.back {
  margin: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-label {
  color: var(--muted);
}

.plain-list {
  margin: 0.4rem 0;
  padding-inline-start: 1.2rem;
}

.plain-list li {
  margin: 0.25rem 0;
}

.off-card {
  max-width: 52rem;
}

.off-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.off-head .card-title {
  margin: 0;
}

/* ---------------------------------------------------------------- marks, states */

.attn {
  display: inline-block;
  flex: none;
  width: 0.72em;
  height: 0.72em;
  border-radius: 50%;
  background: var(--rose);
  margin-inline-end: 0.45em;
}

.lv {
  display: inline-block;
  flex: none;
  width: 0.72em;
  height: 0.72em;
  border-radius: 50%;
  border: 2px solid var(--muted);
  margin-inline-end: 0.45em;
}

.lv-ok {
  background: var(--ivory);
  border-color: var(--ivory);
}

.lv-warn {
  border-color: var(--lavender);
}

.lv-off {
  border-color: var(--disabled);
}

.state-ok,
.state-off,
.state-alarm,
.level {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.state-off {
  color: var(--muted);
}

.level-word {
  font-size: 0.85rem;
}

.lvl-crit .level-word {
  font-weight: 700;
}

.state {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.6rem 0;
  color: var(--muted);
}

.state-text {
  margin: 0;
}

.state-error,
.state-offline {
  color: var(--text);
}

.stale-note {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.4rem 0.7rem;
  margin-bottom: 0.6rem;
  background: var(--surface2);
  border-inline-start: 4px solid var(--rose);
  border-radius: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.6rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.b-on {
  border-color: var(--lavender);
  color: var(--lavender);
}

.b-off {
  color: var(--muted);
}

.b-warn {
  border-color: var(--lavender);
  color: var(--text);
}

.b-bad {
  border-color: var(--rose);
  color: var(--text);
}

.b-dashed {
  border-style: dashed;
  border-color: var(--muted);
}

.b-outline {
  color: var(--text);
}

.chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.status-cell {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
}

.alerts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.alert {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface0);
  border: 2px solid var(--line);
  border-inline-start-width: 4px;
  border-radius: 6px;
}

.alert-crit {
  border-color: var(--rose);
}

.alert-warn {
  border-inline-start-color: var(--lavender);
}

.alert .level {
  min-width: 6.5rem;
}

.alert-text {
  flex: 1;
}

.alert-detail {
  color: var(--muted);
}

.alert-since {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.warn-line {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
  margin: 0 0 0.6rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--rose);
  border-radius: 6px;
}

.warn-line .attn {
  margin-top: 0.45em;
}

/* ---------------------------------------------------------------- buttons, forms */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--text);
  background: var(--surface2);
  border: 2px solid var(--line);
  border-radius: var(--r-btn);
  padding: 0.4rem 1rem;
  min-height: 2.4rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 100ms ease-out, border-color 180ms ease-out;
}

.btn:hover {
  border-color: var(--lavender);
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  min-height: 2rem;
  padding: 0.15rem 0.7rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.btn.primary {
  background: var(--violet);
  border-color: var(--violet);
  color: var(--white);
  box-shadow: 0 5px 0 var(--press);
  margin-block-end: 5px;
}

.btn.primary:hover {
  border-color: var(--violet);
  box-shadow: 0 6px 0 var(--press);
}

.btn.primary:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--press);
}

.btn.danger {
  border-color: var(--rose);
}

.btn.danger.primary {
  background: var(--violet);
  border-color: var(--rose);
}

.btn:disabled {
  color: var(--disabled);
  cursor: not-allowed;
  border-color: var(--line);
}

.btn.primary:disabled {
  background: var(--surface2);
  box-shadow: none;
}

.icon-btn {
  padding-inline: 0.55rem;
}

.actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

input,
select,
textarea {
  color: var(--text);
  background: var(--night);
  border: 2px solid var(--line);
  border-radius: var(--r-input);
  padding: 0.4rem 0.7rem;
  min-height: 2.4rem;
  max-width: 100%;
}

textarea {
  width: 100%;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

input:disabled,
select:disabled {
  color: var(--disabled);
}

input[type="checkbox"] {
  min-height: 0;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--violet);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.field label,
.toolbar label {
  color: var(--muted);
  font-size: 0.88rem;
}

.field-check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.field-check label {
  color: var(--text);
  font-size: 1rem;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.form-row .field {
  flex: 1 1 13rem;
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-width: 34rem;
}

.form-msg {
  min-height: 1.4em;
  margin: 0;
}

.form-msg:empty {
  display: none;
}

.form-msg.bad {
  border-inline-start: 4px solid var(--rose);
  padding-inline-start: 0.6rem;
}

.form-msg.ok {
  color: var(--lavender);
}

.pw {
  display: flex;
  gap: 0.3rem;
}

.pw input {
  flex: 1;
  min-width: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 16rem;
  color: var(--muted);
}

.search-box input {
  flex: 1;
}

.perm-set {
  border: 2px solid var(--line);
  border-radius: var(--r-input);
  padding: 0.5rem 0.8rem 0.7rem;
}

.perm-set legend {
  color: var(--muted);
  font-size: 0.88rem;
  padding-inline: 0.3rem;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.3rem 0;
}

.check-row label {
  line-height: 1.3;
}

.seg {
  display: inline-flex;
  border: 2px solid var(--line);
  border-radius: var(--r-btn);
  overflow: hidden;
}

.seg-btn {
  background: transparent;
  color: var(--lavender);
  border: 0;
  border-inline-end: 2px solid var(--line);
  padding: 0.3rem 0.85rem;
  min-height: 2.1rem;
  cursor: pointer;
}

.seg-btn:last-child {
  border-inline-end: 0;
}

.seg-btn:hover {
  background: var(--surface2);
}

.seg-btn[aria-pressed="true"] {
  background: var(--violet);
  color: var(--white);
  font-weight: 650;
}

.hints {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.9rem;
}

.hints li {
  display: flex;
  align-items: center;
}

.hint-no {
  color: var(--muted);
}

.strength {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 1.4rem;
}

.sbars {
  display: inline-flex;
  gap: 4px;
}

.sbar {
  width: 1.6rem;
  height: 0.5rem;
  background: var(--line);
}

.sbar.on {
  background: var(--lavender);
}

.sword {
  font-size: 0.9rem;
  color: var(--text);
}

.secret-box {
  border: 2px solid var(--lavender);
  border-radius: var(--r-card);
  padding: 0.9rem;
  background: var(--surface0);
}

.secret-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.secret {
  flex: 1 1 18rem;
  font-family: var(--mono);
  direction: ltr;
  text-align: start;
}

.secret-actions {
  margin-top: 0.8rem;
}

.copy-status {
  color: var(--lavender);
  font-size: 0.9rem;
}

.secret-slot:empty {
  display: none;
}

/* ---------------------------------------------------------------- tables */

.tablewrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  text-align: start;
  white-space: nowrap;
  border-bottom: 2px solid var(--line);
}

.table th,
.table td {
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table td.num,
.table th.num {
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table tr.alarm td:first-child {
  border-inline-start: 4px solid var(--rose);
}

.table tr.banned td:first-child {
  border-inline-start: 4px solid var(--rose);
}

.table tr.dim td {
  color: var(--muted);
}

.table tr.open td {
  background: var(--surface2);
}

.table tr.clickable {
  cursor: pointer;
}

.table tr.clickable:hover td {
  background: var(--surface2);
}

.table td.wide {
  padding: 0.4rem 0 0.8rem;
}

.table td.nowrap {
  white-space: nowrap;
}

.table td.wrap {
  min-width: 7rem;
  max-width: 22rem;
  overflow-wrap: break-word;
}

.row-link {
  font-weight: 650;
}

.members-box {
  background: var(--surface0);
  border: 2px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.8rem 0.8rem;
}

.members-box .kvs {
  margin-top: 0.6rem;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.pager-buttons {
  display: inline-flex;
  gap: 0.4rem;
}

.more {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.action-cell {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.said {
  font-weight: 600;
}

.kvs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 0.1rem 1.5rem;
  margin: 0;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  text-align: end;
  min-width: 0;
  overflow-wrap: anywhere;
}

.stack-list {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.profile-name {
  font-size: 1.5rem;
}

.profile-sub {
  color: var(--muted);
  margin: 0.1rem 0 0;
}

.profile-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.root-line {
  display: flex;
  align-items: center;
  margin: 0;
  font-weight: 600;
}

.viewer-slot:empty {
  display: none;
}

/* ---------------------------------------------------------------- meters */

.meters {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.meter-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.meter-label {
  font-weight: 600;
}

.meter-value {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.meter-svg {
  display: block;
  width: 100%;
  height: 0.7rem;
  margin-top: 0.25rem;
}

.meter-track {
  fill: var(--line);
}

.meter-fill.m-ok {
  fill: var(--violet);
}

.meter-fill.m-warn {
  fill: var(--lavender);
}

.meter-fill.m-crit {
  fill: var(--ivory);
  stroke: var(--rose);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.meter-mark {
  stroke: var(--night);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.meter-detail {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

/* ---------------------------------------------------------------- charts */

.chart {
  margin: 0;
  min-width: 0;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chart-cap {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.chart-title {
  font-weight: 650;
}

.chart-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

.chart-switch {
  color: var(--muted);
}

.chart-plot {
  position: relative;
  margin-top: 0.3rem;
  min-width: 0;
}

.chart-plot:focus-visible {
  outline-offset: 0;
}

.plot-svg {
  display: block;
  max-width: 100%;
  height: auto;
  overflow: visible;
}

.chart-empty {
  color: var(--muted);
  padding: 1.2rem 0;
  margin: 0;
}

.chart-mini .chart-title {
  font-size: 0.95rem;
}

.chart-table {
  margin-top: 0.5rem;
  max-height: 22rem;
  overflow: auto;
}

.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.1rem;
  margin: 0.4rem 0 0;
  padding: 0;
  font-size: 0.88rem;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-val {
  color: var(--muted);
}

.swatch {
  flex: none;
}

.gridline {
  stroke: var(--line);
  stroke-width: 1;
}

.tick {
  stroke: var(--muted);
  stroke-width: 1;
}

.axis-text {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font);
}

.end-text {
  fill: var(--text);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font);
}

.ref {
  stroke: var(--rose);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.ref-text {
  fill: var(--text);
}

.ln {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.ln.s1,
.sw-line.s1,
.tip-key.s1 {
  stroke: var(--ivory);
}

.ln.s2,
.sw-line.s2,
.tip-key.s2 {
  stroke: var(--lavender);
}

.ln.s3,
.sw-line.s3,
.tip-key.s3 {
  stroke: var(--violet);
}

.ln.s4,
.sw-line.s4,
.tip-key.s4 {
  stroke: var(--muted);
}

.ln.sx,
.sw-line.sx,
.tip-key.sx {
  stroke: var(--rose);
}

.sw-line,
.tip-key {
  stroke-width: 2;
}

.area.s1 {
  fill: var(--ivory);
}

.area.s2 {
  fill: var(--lavender);
}

.area.s3 {
  fill: var(--violet);
}

.area.s4 {
  fill: var(--muted);
}

.area {
  fill-opacity: 0.12;
}

.mk {
  stroke: var(--card);
  stroke-width: 2;
}

.mk.s1,
.sw.s1,
.bar.s1,
.slice.s1 {
  fill: var(--ivory);
}

.mk.s2,
.sw.s2,
.bar.s2,
.slice.s2 {
  fill: var(--lavender);
}

.mk.s3,
.sw.s3,
.bar.s3,
.slice.s3 {
  fill: var(--violet);
}

.mk.s4,
.sw.s4,
.bar.s4,
.slice.s4 {
  fill: var(--muted);
}

.mk.sx,
.mk-cross {
  fill: none;
  stroke: var(--rose);
  stroke-width: 2;
}

.bar.sx,
.slice.sx,
.sw.sx {
  fill: none;
  stroke: var(--rose);
  stroke-width: 2;
}

.slice {
  stroke: var(--card);
  stroke-width: 0;
}

.slice.sx {
  stroke: var(--rose);
  stroke-width: 2;
}

.cursor-line {
  stroke: var(--muted);
  stroke-width: 1;
}

.cursor-band {
  fill: var(--text);
  fill-opacity: 0.08;
}

.tip-bg {
  fill: var(--surface2);
  stroke: var(--lavender);
  stroke-width: 1;
}

.tip-title {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font);
}

.tip-val {
  fill: var(--text);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
}

.tip-label {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font);
}

.heat-cell.hb0 {
  fill: var(--line);
}

.heat-cell.hb1 {
  fill: var(--press);
}

.heat-cell.hb2 {
  fill: var(--wash-deep);
}

.heat-cell.hb3 {
  fill: var(--violet);
}

.heat-cell.hb4 {
  fill: var(--gouge);
}

.heat-cell.hb5 {
  fill: var(--lavender);
}

.heat-cell.hb6 {
  fill: var(--ivory);
}

.heat-cursor {
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
}

.spark {
  overflow: visible;
}

.spark .mk {
  stroke: var(--card);
}

.spark-empty {
  stroke: var(--line);
  stroke-width: 2;
}

.donut-body {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.donut-ring {
  position: relative;
  width: 132px;
  height: 132px;
  flex: none;
}

.donut-svg {
  display: block;
}

.donut-empty {
  stroke: var(--line);
}

.donut-centre {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  pointer-events: none;
}

.donut-num {
  font-size: 1.15rem;
  font-weight: 700;
}

.donut-cap {
  color: var(--muted);
  font-size: 0.72rem;
}

.donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 10rem;
}

.donut-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dl-label {
  flex: 1;
}

.dl-val {
  font-variant-numeric: tabular-nums;
}

.bar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.bl-row {
  display: grid;
  grid-template-columns: minmax(0, 8rem) minmax(2rem, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
}

.bl-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bl-label > bdi {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bl-sub {
  color: var(--muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bl-bar {
  width: 100%;
  height: 0.6rem;
  display: block;
}

.bl-track {
  fill: var(--line);
}

.bl-fill.s1 {
  fill: var(--lavender);
}

.bl-fill.s2 {
  fill: var(--violet);
}

.bl-val {
  font-variant-numeric: tabular-nums;
  text-align: end;
  min-width: 4.5rem;
}

.bl-share {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------- the log viewer */

.logview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.log-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
}

.log-count {
  color: var(--muted);
  font-size: 0.9rem;
  min-width: 6rem;
}

.log {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  background: var(--night);
  border: 2px solid var(--line);
  border-radius: var(--r-input);
  max-height: 34rem;
  overflow: auto;
  padding: 0.4rem 0;
}

.log .ll {
  display: flex;
  gap: 0.8rem;
  padding-inline: 0.6rem;
}

.log .lno {
  flex: none;
  min-width: 4ch;
  text-align: end;
  color: var(--disabled);
  user-select: none;
}

.log .lt {
  flex: 1;
  min-width: 0;
  text-align: start;
}

.log.wrap .lt {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.log.nowrap .lt {
  white-space: pre;
}

.log mark {
  background: var(--wash-deep);
  color: var(--white);
  border-radius: 2px;
}

.log mark.cur {
  background: var(--ivory);
  color: var(--night);
}

.log-progress {
  color: var(--muted);
  font-size: 0.85rem;
  min-height: 1.2em;
}

/* ---------------------------------------------------------------- dialog */

.dialog {
  background: var(--card);
  color: var(--text);
  border: 2px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 8px 8px 0 var(--shadow);
  padding: 1.25rem 1.4rem;
  width: min(34rem, 94vw);
}

.dialog::backdrop {
  background: var(--night);
  opacity: 0.8;
}

.dlg-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.dlg-head {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.dlg-head h2 {
  font-size: 1.2rem;
}

.dlg-body p {
  margin: 0;
  color: var(--muted);
}

.dlg-fields {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.dlg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.4rem;
  padding-bottom: 5px;
}

/* ---------------------------------------------------------------- narrow screens */

@media (max-width: 1100px) {
  .cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tile-hero {
    grid-column: span 1;
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    display: none;
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(18rem, 86vw);
    height: auto;
    z-index: 50;
  }

  .side.open {
    display: flex;
  }

  .top .nav-toggle {
    display: inline-flex;
  }

  .top {
    padding: 0.6rem 0.85rem;
  }

  .view-title {
    font-size: 1.35rem;
    margin-inline-end: 0;
    flex: 1;
  }

  html[lang="ar"] .view-title {
    font-size: 1.45rem;
  }

  .main {
    padding-inline: 0.85rem;
  }

  .banner {
    padding-inline: 0.85rem;
  }

  .cols,
  .cols-3,
  .chart-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .refresh-text,
  .user-name {
    display: none;
  }

  .top-tools {
    margin-inline-start: auto;
  }

  .scope-label {
    display: none;
  }

  .scope-slot {
    flex: 1 0 100%;
  }

  .scope-select {
    inline-size: 100%;
    max-inline-size: none;
  }
}

@media (max-width: 700px) {
  .tile-value {
    font-size: 1.6rem;
  }

  .tile-hero .tile-value {
    font-size: 2.3rem;
  }

  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tile-hero {
    grid-column: span 2;
  }

  .table.stack thead {
    display: none;
  }

  .table.stack,
  .table.stack tbody,
  .table.stack tr,
  .table.stack td {
    display: block;
    width: 100%;
  }

  .table.stack tr {
    border: 2px solid var(--line);
    border-radius: 6px;
    margin: 0 0 0.6rem;
    padding: 0.35rem 0.7rem;
    background: var(--surface0);
  }

  .table.stack td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    border: 0;
    padding: 0.22rem 0;
    text-align: end;
    max-width: none;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .table.stack td::before {
    content: attr(data-label);
    color: var(--muted);
    text-align: start;
    flex: none;
    font-size: 0.85rem;
  }

  .table.stack td.num,
  .table.stack td.nowrap {
    white-space: normal;
  }

  .table.stack td.wide {
    display: block;
    padding: 0;
  }

  .table.stack td.wide::before {
    content: none;
  }

  .table.stack tr.members {
    border: 0;
    padding: 0;
    background: transparent;
  }

  .table.stack tr.alarm td:first-child,
  .table.stack tr.banned td:first-child {
    border-inline-start: 0;
  }

  .table.stack tr.alarm,
  .table.stack tr.banned {
    border-inline-start: 4px solid var(--rose);
  }

  .kvs {
    grid-template-columns: minmax(0, 1fr);
  }

  .bl-row {
    grid-template-columns: minmax(0, 7rem) minmax(0, 1fr) auto;
  }

  .alert {
    flex-wrap: wrap;
    gap: 0.2rem 0.75rem;
  }

  .alert .level {
    order: 1;
    min-width: 0;
  }

  .alert .alert-since {
    order: 2;
    margin-inline-start: auto;
  }

  .alert .alert-text {
    order: 3;
    flex: 1 1 100%;
  }

  .toasts {
    inset-inline: 0.75rem;
    max-width: none;
  }

  .gate-card {
    padding: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .nav-item {
    transition: none;
  }
}

@media (forced-colors: active) {
  .attn,
  .lv,
  .sbar.on {
    forced-color-adjust: none;
  }
}

.player-tag {
  color: var(--muted);
}

.two-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.small-text {
  font-size: 0.8rem;
}

.hints .muted {
  margin-inline-start: 0.5rem;
}

.hidden-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.kv dd .hidden-note {
  justify-content: flex-end;
  text-align: end;
}

/* ---------------------------------------------------------------- Content > Shop order */

.shop-status {
  color: var(--muted);
  margin: 0.25rem 0 0.6rem;
}

.shop-notes:empty {
  display: none;
}

.shop-notes .note {
  margin-block: 0.4rem;
}

.shop-cats {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.shop-cat {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r-card);
  padding: 0.7rem 1rem 0.9rem;
  min-width: 0;
}

.shop-cat.dirty {
  border-color: var(--lavender);
}

.shop-cat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.shop-cat-name {
  font-size: 1.05rem;
}

.shop-pos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  height: 1.9rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
}

.shop-id {
  color: var(--muted);
  font-size: 0.85rem;
}

.shop-count {
  margin-inline-start: auto;
}

.shop-items {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
}

.shop-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.9rem;
  padding: 0.3rem 0.4rem;
  border-block-start: 1px solid var(--line);
  border-inline-start: 3px solid transparent;
}

.shop-item.dirty {
  border-inline-start-color: var(--lavender);
  background: var(--surface0);
}

.shop-item-name {
  flex: 1 1 14rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 0.6rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.stars {
  display: inline-flex;
}

.star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--r-input);
  cursor: pointer;
}

.star svg {
  width: 1.3rem;
  height: 1.3rem;
}

.star.on {
  color: var(--lavender);
}

.star.on svg {
  fill: currentColor;
}

.star:hover:not(:disabled) {
  border-color: var(--lavender);
}

.star:disabled {
  cursor: not-allowed;
  color: var(--disabled);
}

.shop-rating {
  min-width: 9.5rem;
  font-size: 0.9rem;
}

.shop-savebar {
  position: sticky;
  inset-block-end: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-block-start: 1rem;
  padding: 0.7rem 1rem;
  background: var(--surface0);
  border: 2px solid var(--line);
  border-radius: var(--r-card);
}

.shop-savebar .form-msg {
  flex: 1 1 100%;
  margin: 0;
}

.shop-savebar .form-msg:empty {
  display: none;
}

.shop-counter {
  margin-inline-end: auto;
  color: var(--muted);
}

.shop-counter.dirty {
  color: var(--text);
}

@media (max-width: 700px) {
  .shop-count {
    margin-inline-start: 0;
  }

  .shop-rating {
    min-width: 0;
  }
}

/* games pages */

.game-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding-block-end: 0.6rem;
  border-block-end: 2px solid var(--line);
}

.game-name {
  margin: 0;
  font-size: 1.25rem;
}

.games-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-inline-size: 46rem;
}

.games-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.8rem 1rem;
}

/* apps pages */

.apps-tabs {
  display: flex;
  flex-wrap: wrap;
  border-block-end: 2px solid var(--line);
}

.apps-tab {
  padding: 0.55rem 1.1rem;
  color: var(--lavender);
  text-decoration: none;
  border-block-end: 2px solid transparent;
  margin-block-end: -2px;
}

.apps-tab:hover,
.apps-tab.on {
  color: var(--text);
  border-block-end-color: var(--violet);
}

.apps-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-block-start: 1rem;
}

.apps-slot {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.apps-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.apps-json {
  inline-size: 100%;
  min-block-size: 10rem;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.apps-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.apps-size {
  color: var(--muted);
  font-size: 0.85rem;
}

.apps-size.bad {
  color: var(--text);
  border-block-end: 2px solid var(--rose);
}

.apps-flags,
.apps-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin: 0;
}

.apps-flag {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.apps-history-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-block-start: 1rem;
  padding-block-start: 0.8rem;
  border-block-start: 2px solid var(--line);
}

.apps-pre {
  margin: 0;
  padding: 0.7rem;
  max-block-size: 22rem;
  overflow: auto;
  background: var(--night);
  border: 2px solid var(--line);
  font-family: var(--mono);
  font-size: 0.85rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* community pages */
.comm-bars {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.2rem;
  margin-block-end: 0.9rem;
}

.comm-views {
  display: flex;
}

.comm-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comm-block {
  padding-block: 0.7rem;
  padding-inline-start: 0.8rem;
  border-inline-start: 3px solid var(--line);
  margin-block-end: 1rem;
}

.comm-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
}

.comm-sub {
  margin-block: 0.6rem 0.3rem;
  font-size: 1rem;
  color: var(--lavender);
}

.two-line {
  display: flex;
  flex-direction: column;
}

.small-text {
  font-size: 0.85rem;
}

/* team partner */
.team-partner {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-block: 0.5rem;
  padding-inline-start: 0.8rem;
  border-inline-start: 3px solid var(--line);
}

.team-partner[hidden] {
  display: none;
}

.team-partner > .field {
  flex: 1 1 16rem;
}

.team-rolebox {
  flex: 1 1 18rem;
}

.team-games {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-block-size: 11rem;
  overflow-y: auto;
}

.team-games-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.team-gid {
  color: var(--muted);
  font-size: 0.82rem;
}

.team-dlg {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.team-scope {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.team-scope-games {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* analytics pages */
.an-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}

.an-bar-end {
  margin-inline-start: auto;
}

.an-fresh {
  margin: 0;
  color: var(--muted);
}

.an-ret th,
.an-ret td {
  vertical-align: middle;
}

.an-week {
  white-space: nowrap;
  font-weight: 600;
}

.an-cell {
  min-inline-size: 5.2rem;
  border: 2px solid var(--night);
}

.an-pct {
  display: block;
  font-weight: 700;
}

.an-sub {
  display: block;
  font-size: 0.78rem;
  opacity: 0.85;
}

.an-hb0 {
  background: var(--line);
  color: var(--muted);
}

.an-hb1 {
  background: var(--press);
  color: var(--text);
}

.an-hb2 {
  background: var(--wash-deep);
  color: var(--white);
}

.an-hb3 {
  background: var(--violet);
  color: var(--white);
}

.an-hb4 {
  background: var(--gouge);
  color: var(--night);
}

.an-hb5 {
  background: var(--lavender);
  color: var(--night);
}

.an-hb6 {
  background: var(--ivory);
  color: var(--night);
}

/* store pages */
.store-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  margin-block-end: 12px;
}

.store-items {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.store-was {
  color: var(--disabled);
  text-decoration: line-through;
  margin-inline-start: 6px;
}

.store-more {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-start: 12px;
}

.store-readonly {
  color: var(--muted);
  border-inline-start: 2px solid var(--line);
  padding-inline-start: 10px;
  margin-block-end: 12px;
}

.store-refund-row td {
  color: var(--muted);
  border-inline-start: 2px solid var(--rose);
}

.store-refund-row td:first-child {
  padding-inline-start: 18px;
}

.store-filter {
  min-inline-size: 140px;
}

.store-revenue > * + * {
  margin-block-start: 12px;
}

.money {
  font-variant-numeric: tabular-nums;
  unicode-bidi: isolate;
  direction: ltr;
}
