:root {
  color-scheme: dark;
  --bg: #050807;
  --panel: #0c1110;
  --panel-2: #121917;
  --panel-3: #18211e;
  --line: rgba(225, 242, 226, 0.16);
  --line-strong: rgba(208, 255, 66, 0.72);
  --text: #f5f8f4;
  --muted: #9ca69f;
  --muted-2: #6f7a73;
  --lime: #d0ff42;
  --lime-2: #b9f600;
  --lime-dark: #24370d;
  --danger: #ff625a;
  --warning: #ffd761;
  --surface-radius: 20px;
  --control-radius: 999px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --workspace-sidebar-width: 161px;
  --workspace-center: 76fr;
  --workspace-right: 14fr;
  --workspace-gap: 16px;
  --ttmiao-medal-white-rim:
    drop-shadow(1.15px 0 0 rgba(248, 250, 249, 0.86))
    drop-shadow(-1.15px 0 0 rgba(248, 250, 249, 0.82))
    drop-shadow(0 1.15px 0 rgba(231, 235, 233, 0.74))
    drop-shadow(0 -1.15px 0 rgba(250, 252, 251, 0.84))
    drop-shadow(0 9px 9px rgba(0, 0, 0, 0.64));
  --ttmiao-medal-white-rim-compact:
    drop-shadow(0.75px 0 0 rgba(248, 250, 249, 0.82))
    drop-shadow(-0.75px 0 0 rgba(248, 250, 249, 0.78))
    drop-shadow(0 0.75px 0 rgba(231, 235, 233, 0.7))
    drop-shadow(0 -0.75px 0 rgba(250, 252, 251, 0.8))
    drop-shadow(0 5px 6px rgba(0, 0, 0, 0.58));
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #030605;
  background-size: 76px 76px;
  color: var(--text);
}

body {
  min-height: 100vh;
}

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

button {
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(18, 25, 23, 0.96), rgba(7, 10, 9, 0.98));
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(208, 255, 66, 0.48);
  border-radius: var(--control-radius);
  background: rgba(208, 255, 66, 0.1);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.login-card h1,
.title-group h1,
.panel-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-card h1 {
  margin-top: 18px;
  font-size: 28px;
  line-height: 1.14;
}

.login-card p,
.title-group p,
.panel-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.login-card label,
.edit-form label {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.login-card input,
.edit-form input,
.edit-form select,
.edit-form textarea,
.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.36);
  color: var(--text);
}

.login-card input {
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
}

.primary-action,
.secondary-action,
.danger-action,
.icon-action,
.view-tab,
.table-tab,
.small-action {
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.primary-action {
  width: 100%;
  height: 46px;
  margin-top: 22px;
  border-color: var(--lime);
  background: var(--lime);
  color: #071000;
  font-weight: 800;
}

.edit-form .primary-action {
  width: auto;
  min-width: 120px;
  padding: 0 18px;
}

.primary-action:hover,
.primary-action:focus-visible {
  background: #deff70;
}

.primary-action:active,
.secondary-action:active,
.danger-action:active,
.icon-action:active,
.view-tab:active,
.table-tab:active,
.small-action:active,
.rule-node:active {
  transform: translateY(1px);
}

.form-error {
  min-height: 20px;
  color: var(--danger) !important;
  font-size: 13px;
}

.rules-app {
  width: min(1860px, calc(100vw - 48px));
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  padding: 24px;
  border: 1px solid rgba(225, 242, 226, 0.18);
  border-radius: 28px;
  background: rgba(3, 6, 5, 0.88);
}

.top-shell,
.status-strip,
.filter-bar,
.sidebar-panel,
.primary-panel,
.detail-panel {
  border: 1px solid var(--line);
  background: rgba(12, 17, 16, 0.92);
}

.top-shell {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
  border-radius: 22px;
}

.title-group {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.title-group h1 {
  font-size: 28px;
  line-height: 1.14;
}

.top-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.top-primary-action {
  width: auto;
  min-height: 42px;
  margin-top: 0;
  padding: 0 18px;
  white-space: nowrap;
}

.advanced-maintenance-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(225, 242, 226, 0.1);
}

.maintenance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.advanced-maintenance-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  align-items: center;
  flex: 1 1 280px;
  min-width: 240px;
  max-width: 440px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: rgba(0, 0, 0, 0.32);
  color: var(--muted);
  font-size: 13px;
}

.search-box input {
  height: 38px;
  padding: 0 0 0 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: 0;
}

.search-box input::placeholder {
  color: #9fa89e;
}

.version-chip,
.secondary-action,
.danger-action,
.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.version-chip {
  border-radius: var(--control-radius);
  background: rgba(208, 255, 66, 0.17);
  color: var(--lime);
  font-family: var(--mono);
}

.secondary-action:hover,
.secondary-action:focus-visible,
.icon-action:hover,
.icon-action:focus-visible,
.table-tab:hover,
.view-tab:hover,
.small-action:hover {
  border-color: rgba(208, 255, 66, 0.56);
  color: var(--lime);
}

.danger-action {
  border-color: rgba(255, 98, 90, 0.42);
  color: #ffb4ae;
}

.danger-action:hover,
.danger-action:focus-visible {
  background: rgba(255, 98, 90, 0.12);
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  border-radius: 18px;
}

.status-strip div {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.status-strip strong {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 20px;
}

.status-strip span,
.status-strip p {
  color: var(--muted);
  font-size: 12px;
}

.status-strip p {
  margin: 0;
  justify-self: end;
}

.maintenance-only {
  display: none !important;
}

.view-tab,
.table-tab,
.table-category-tab {
  min-height: 34px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 720;
}

.table-tab.active,
.table-category-tab.active {
  border-color: var(--lime);
  background: var(--lime);
  color: #061000;
}

.workspace {
  display: grid;
  grid-template-columns:
    var(--workspace-sidebar-width)
    minmax(0, var(--workspace-center))
    minmax(240px, var(--workspace-right));
  gap: var(--workspace-gap);
  margin-top: 14px;
  align-items: start;
}

.workspace.workspace-wide {
  grid-template-columns:
    var(--workspace-sidebar-width)
    minmax(0, var(--workspace-center))
    minmax(240px, var(--workspace-right));
}

.workspace.workspace-xp-sheet {
  grid-template-columns:
    var(--workspace-sidebar-width)
    minmax(0, var(--workspace-center))
    minmax(240px, var(--workspace-right));
}

.workspace.workspace-medal-board {
  grid-template-columns: var(--workspace-sidebar-width) minmax(0, 79fr) minmax(180px, 12fr);
  gap: 12px;
}

.workspace.workspace-wide .detail-panel {
  position: sticky;
  max-height: calc(100vh - 36px);
}

.sidebar-panel,
.primary-panel,
.detail-panel {
  min-width: 0;
  min-height: 660px;
  border-radius: var(--surface-radius);
  overflow: hidden;
}

.sidebar-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  padding: 12px;
  overflow: auto;
}

.sidebar-block + .sidebar-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(225, 242, 226, 0.1);
}

.sidebar-label,
.sidebar-system-title {
  display: block;
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.view-tabs {
  display: grid;
  gap: 7px;
}

.view-tab {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  text-align: left;
}

.view-tab.active {
  border-color: var(--lime);
  background: rgba(208, 255, 66, 0.16);
  color: var(--lime);
}

.sidebar-system-nav {
  display: grid;
  gap: 14px;
}

.sidebar-system-list {
  display: grid;
  gap: 6px;
}

.sidebar-system-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid rgba(225, 242, 226, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
}

.sidebar-system-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-system-button em {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
}

.sidebar-system-button:hover,
.sidebar-system-button:focus-visible,
.sidebar-system-button.active {
  border-color: rgba(208, 255, 66, 0.58);
  background: rgba(208, 255, 66, 0.1);
  color: var(--lime);
}

.sidebar-system-button.active em {
  color: var(--lime);
}

.sidebar-tree-list,
.sidebar-tree-children {
  display: grid;
  gap: 6px;
}

.sidebar-tree-node {
  display: grid;
  gap: 6px;
}

.sidebar-tree-parent {
  min-height: 36px;
}

.sidebar-tree-children {
  position: relative;
  margin-left: 8px;
  padding-left: 9px;
}

.sidebar-tree-children::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 1px;
  background: rgba(208, 255, 66, 0.22);
}

.sidebar-tree-child {
  min-height: 32px;
  padding-left: 9px;
  border-color: rgba(225, 242, 226, 0.08);
  background: rgba(0, 0, 0, 0.18);
}

.sidebar-tree-child span {
  font-size: 12px;
}

.primary-panel {
  position: relative;
}

.view-panel {
  display: none;
  height: 100%;
  min-width: 0;
  padding: 18px;
}

.view-panel.active {
  display: block;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-heading h2 {
  font-size: 22px;
  line-height: 1.2;
}

.panel-heading > span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: var(--control-radius);
  background: rgba(208, 255, 66, 0.12);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 12px;
}

.tree-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(168px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  padding-bottom: 10px;
  scrollbar-color: rgba(208, 255, 66, 0.52) rgba(255, 255, 255, 0.06);
}

.system-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.system-scope-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.system-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 14px;
  padding: 10px;
  border: 1px solid rgba(225, 242, 226, 0.1);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
}

.system-scope-tab,
.system-tab,
.feature-toggle {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.system-scope-tab,
.system-tab {
  min-height: 36px;
  padding: 0 16px;
  border-radius: var(--control-radius);
  font-size: 13px;
  font-weight: 760;
}

.system-tab {
  min-height: 34px;
  padding: 0 14px;
}

.system-scope-tab span,
.system-tab span {
  margin-left: 6px;
  color: var(--muted);
  font-family: var(--mono);
}

.system-scope-tab:hover,
.system-scope-tab:focus-visible,
.system-tab:hover,
.system-tab:focus-visible,
.feature-toggle:hover,
.feature-toggle:focus-visible {
  border-color: rgba(208, 255, 66, 0.56);
  color: var(--lime);
}

.system-scope-tab.active,
.system-tab.active {
  border-color: var(--lime);
  background: var(--lime);
  color: #061000;
}

.system-scope-tab.active span,
.system-tab.active span {
  color: rgba(6, 16, 0, 0.72);
}

.system-editor-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
  align-items: start;
}

.system-editor-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.single-system-tree {
  min-height: 520px;
}

.system-editor-card--deprecated {
  margin-top: 12px;
  border-color: rgba(255, 215, 97, 0.42);
}

.system-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.1);
  background: rgba(208, 255, 66, 0.08);
}

.system-editor-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.system-editor-head strong {
  color: var(--lime);
  font-size: 17px;
  line-height: 1.2;
}

.system-editor-head span,
.system-editor-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.system-editor-head em {
  white-space: nowrap;
}

.feature-list {
  display: grid;
}

.feature-section + .feature-section {
  border-top: 1px solid rgba(225, 242, 226, 0.08);
}

.feature-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 0;
  border-radius: 0;
  text-align: left;
}

.feature-toggle::before {
  content: "+";
  display: inline-grid;
  grid-column: 3;
  grid-row: 1;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: 8px;
  border: 1px solid rgba(208, 255, 66, 0.32);
  border-radius: 999px;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
}

.feature-toggle.active::before {
  content: "-";
  background: rgba(208, 255, 66, 0.14);
}

.feature-toggle span {
  min-width: 0;
  color: var(--text);
  font-weight: 780;
  line-height: 1.25;
}

.feature-toggle em {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.feature-rules {
  display: grid;
  gap: 6px;
  padding: 0 12px 12px;
}

.feature-rules.expanded {
  animation: revealRules 160ms ease-out;
}

.system-inner-summary-strip,
.medal-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.08);
}

.system-inner-summary-strip div,
.medal-summary-strip div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(208, 255, 66, 0.16);
  border-radius: 12px;
  background: rgba(208, 255, 66, 0.055);
}

.system-inner-summary-strip strong,
.medal-summary-strip strong {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 20px;
  line-height: 1.05;
}

.system-inner-summary-strip span,
.medal-summary-strip span {
  color: var(--muted);
  font-size: 12px;
}

.system-inner-filter-tabs,
.medal-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 12px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.08);
}

.system-inner-filter-tab,
.medal-filter-tab {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
}

.system-inner-filter-tab:hover,
.system-inner-filter-tab:focus-visible,
.medal-filter-tab:hover,
.medal-filter-tab:focus-visible {
  border-color: rgba(208, 255, 66, 0.56);
  color: var(--lime);
}

.system-inner-filter-tab.active,
.medal-filter-tab.active {
  border-color: var(--lime);
  background: var(--lime);
  color: #061000;
}

.system-inner-filter-tab span,
.medal-filter-tab span {
  font-family: var(--mono);
}

.system-inner-match-line {
  padding: 9px 12px 12px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.08);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.planning-feature-list {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.xp-sheet-panel {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.xp-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.1);
  background: rgba(208, 255, 66, 0.08);
}

.xp-sheet-head div {
  display: grid;
  gap: 3px;
}

.xp-sheet-head strong {
  color: var(--lime);
  font-size: 20px;
  line-height: 1.2;
}

.xp-sheet-head span,
.xp-sheet-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.medal-series-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.1);
  background: rgba(208, 255, 66, 0.045);
}

.medal-series-tab {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(225, 242, 226, 0.16);
  border-radius: 999px;
  background: rgba(10, 13, 12, 0.96);
  color: rgba(245, 248, 244, 0.68);
  font-size: 12px;
  font-weight: 880;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.medal-series-tab:hover,
.medal-series-tab:focus-visible {
  border-color: rgba(208, 255, 66, 0.62);
  color: var(--lime);
}

.medal-series-tab.active {
  border-color: var(--lime);
  background: rgba(208, 255, 66, 0.08);
  color: var(--lime);
  box-shadow:
    inset 0 0 0 1px rgba(208, 255, 66, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.medal-series-tab span {
  margin-left: 4px;
  font-family: var(--mono);
}

.value-sheet-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(208, 255, 66, 0.45) rgba(255, 255, 255, 0.04);
  -webkit-overflow-scrolling: touch;
}

.value-sheet-scroll:focus-visible {
  outline: 1px solid rgba(208, 255, 66, 0.72);
  outline-offset: -1px;
}

.value-sheet-scroll::-webkit-scrollbar {
  height: 9px;
}

.value-sheet-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

.value-sheet-scroll::-webkit-scrollbar-thumb {
  border: 2px solid #0c1110;
  border-radius: var(--control-radius);
  background: rgba(208, 255, 66, 0.45);
}

.xp-sheet-table {
  display: grid;
  width: 100%;
  min-width: var(--value-sheet-min-width, 960px);
  gap: 8px;
  padding: 12px;
}

.xp-sheet-row {
  display: grid;
  grid-template-columns: var(--value-sheet-columns, minmax(140px, 0.72fr) minmax(260px, 1.65fr) minmax(88px, 0.28fr));
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 10px 10px;
  border: 1px solid rgba(225, 242, 226, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  text-align: left;
}

.xp-sheet-row:not(.xp-sheet-row--head):hover,
.xp-sheet-row:not(.xp-sheet-row--head):focus-visible,
.xp-sheet-row.active {
  border-color: rgba(208, 255, 66, 0.62);
  background: rgba(208, 255, 66, 0.085);
}

.xp-sheet-row--head {
  min-height: 36px;
  border-color: rgba(208, 255, 66, 0.2);
  background: rgba(208, 255, 66, 0.1);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.xp-sheet-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.xp-sheet-row .value-sheet-cell {
  width: 100%;
  min-width: 0;
  justify-self: start;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.35;
  text-align: left;
}

.xp-sheet-row .value-sheet-cell:not(:first-child) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.xp-sheet-row .value-sheet-cell:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.value-sheet-cell--right {
  justify-self: start;
  text-align: left;
}

.value-sheet-cell--center {
  justify-self: start;
  text-align: left;
}

.xp-sheet-row strong {
  justify-self: start;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

.value-sheet-status {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: fit-content;
  min-height: 24px;
  padding: 0 8px;
  border-radius: var(--control-radius);
  font-weight: 900;
}

.value-sheet-status.status-pending {
  border: 1px solid rgba(255, 160, 72, 0.56);
  background: rgba(255, 160, 72, 0.12);
  color: #ffb05f !important;
}

.value-sheet-status.status-paused {
  border: 1px solid rgba(255, 185, 72, 0.58);
  background: rgba(255, 185, 72, 0.12);
  color: #ffc36f !important;
}

.value-sheet-group-title {
  margin: 8px 0 0;
  padding: 8px 12px;
  color: var(--lime);
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(208, 255, 66, 0.18);
  border-radius: 12px;
  background: rgba(208, 255, 66, 0.07);
}

.planning-category-section {
  display: grid;
  gap: 8px;
}

.planning-category-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 0 2px;
}

.planning-category-title strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}

.planning-category-title span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.planning-rule-list {
  display: grid;
  gap: 8px;
}

.planning-rule-card {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(225, 242, 226, 0.12);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.planning-rule-card:hover,
.planning-rule-card:focus-visible,
.planning-rule-card.active {
  border-color: rgba(208, 255, 66, 0.58);
  background: rgba(208, 255, 66, 0.075);
}

.planning-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.planning-card-head strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.25;
}

.planning-card-value {
  color: var(--lime);
  font-weight: 820;
  line-height: 1.25;
}

.planning-card-meta,
.planning-card-reward,
.planning-reference {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.planning-card-fields {
  display: grid;
  gap: 5px;
}

.planning-card-fields span {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  color: #d7ddd8;
  font-size: 12px;
  line-height: 1.4;
}

.planning-card-fields em {
  color: var(--muted);
  font-style: normal;
}

.planning-card-reward {
  color: #d7ddd8;
}

.planning-reference {
  color: #aecd75;
}

.reward-type-tabs,
.reward-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.value-system-tabs {
  margin: 0;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.08);
}

.reward-overview-content {
  display: grid;
  gap: 10px;
}

.page-flow-panel {
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.028);
  overflow: hidden;
}

.page-flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.12);
  background: rgba(208, 255, 66, 0.08);
}

.page-flow-head div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.page-flow-head strong {
  color: var(--lime);
  font-size: 22px;
  line-height: 1.16;
}

.page-flow-head span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.page-flow-head em {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-style: normal;
}

.page-reference-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(240px, 28vw, 320px);
  align-items: start;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.1);
}

.page-reference-copy {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  padding: 14px 0 0;
  border: 1px solid rgba(225, 242, 226, 0.1);
  border-radius: 14px;
  border-color: transparent;
  background: transparent;
}

.page-reference-copy strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
}

.page-reference-copy span {
  max-width: 54ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.page-reference-media {
  position: relative;
  width: min(100%, 320px);
  justify-self: end;
  border: 1px solid rgba(208, 255, 66, 0.24);
  border-radius: 18px;
  background: #050807;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.page-reference-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: contain;
  object-position: top center;
  background: #000;
}

.page-reference-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.page-reference-pin {
  position: absolute;
  left: var(--pin-x);
  top: var(--pin-y);
  display: inline-flex;
  max-width: 132px;
  align-items: center;
  gap: 5px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 7px rgba(0, 0, 0, 0.62));
}

.page-reference-pin b {
  display: inline-grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  place-items: center;
  background: var(--lime);
  color: #061000;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
}

.page-reference-pin em {
  display: block;
  max-width: 96px;
  padding: 3px 7px;
  border: 1px solid rgba(208, 255, 66, 0.28);
  border-radius: var(--control-radius);
  background: rgba(0, 0, 0, 0.58);
  color: var(--text);
  font-size: 10px;
  font-style: normal;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-reference-placeholder {
  display: none;
  min-height: 430px;
  place-items: center;
  gap: 6px;
  padding: 22px;
  text-align: center;
}

.page-reference-placeholder strong {
  color: var(--lime);
  font-size: 16px;
}

.page-reference-placeholder span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.page-reference-media.is-missing .page-reference-image,
.page-reference-media.is-missing .page-reference-pins {
  display: none;
}

.page-reference-media.is-missing .page-reference-placeholder {
  display: grid;
}

.mini-program-flow-panel {
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.028);
  overflow: hidden;
}

.mini-program-flow-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 92px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.12);
  background: rgba(208, 255, 66, 0.08);
}

.mini-program-flow-head div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.mini-program-flow-head span,
.mini-program-flow-head p,
.mini-program-flow-head em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.mini-program-flow-head span,
.mini-program-flow-head em {
  font-family: var(--mono);
}

.mini-program-flow-head strong {
  color: var(--lime);
  font-size: 22px;
  line-height: 1.2;
}

.mini-program-flow-head p {
  max-width: 72ch;
  margin: 0;
}

.mini-program-flow-head em {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: var(--control-radius);
  background: rgba(208, 255, 66, 0.1);
  color: var(--lime);
  font-style: normal;
  font-weight: 800;
}

.page-surface-catalog {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.1);
}

.page-surface-catalog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.page-surface-catalog-head > div {
  display: grid;
  max-width: 72ch;
  gap: 5px;
}

.page-surface-catalog-head > div strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
}

.page-surface-catalog-head > div span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.page-surface-catalog-head dl {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
}

.page-surface-catalog-head dl div {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid rgba(225, 242, 226, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
}

.page-surface-catalog-head dt,
.page-surface-catalog-head dd {
  margin: 0;
  font-size: 11px;
}

.page-surface-catalog-head dt {
  color: var(--muted);
}

.page-surface-catalog-head dd {
  color: var(--lime);
  font-family: var(--mono);
  font-weight: 900;
}

.page-surface-filters {
  display: flex;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.page-surface-filters button {
  display: inline-flex;
  min-height: 34px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(225, 242, 226, 0.14);
  border-radius: var(--control-radius);
  background: rgba(255, 255, 255, 0.025);
  color: #dfe6df;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.page-surface-filters button b {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.page-surface-filters button:hover,
.page-surface-filters button:focus-visible,
.page-surface-filters button.active {
  border-color: rgba(208, 255, 66, 0.62);
  background: rgba(208, 255, 66, 0.08);
  color: var(--lime);
  outline: none;
}

.page-surface-filters button.active b {
  color: var(--lime);
}

.page-flow-cluster-filters {
  padding: 14px 18px 0;
}

.page-surface-groups {
  display: grid;
  gap: 20px;
}

.page-surface-group {
  display: grid;
  gap: 10px;
}

.page-surface-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.1);
}

.page-surface-group > header strong {
  color: #edf3ed;
  font-size: 14px;
}

.page-surface-group > header span {
  color: var(--muted);
  font-size: 11px;
}

.page-surface-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.page-surface-card {
  display: grid;
  min-width: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(225, 242, 226, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.page-surface-card:hover,
.page-surface-card:focus-within {
  border-color: rgba(208, 255, 66, 0.48);
}

.page-surface-preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 440 / 956;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(225, 242, 226, 0.1);
  background: #020303;
  cursor: zoom-in;
  overflow: hidden;
}

.page-surface-preview:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: -2px;
}

.page-surface-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.page-surface-missing {
  display: none;
  height: 100%;
  place-content: center;
  gap: 5px;
  color: var(--muted);
  text-align: center;
}

.page-surface-missing b {
  color: #ffc36f;
  font-size: 12px;
}

.page-surface-missing em {
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
}

.page-surface-card.is-missing .page-surface-preview img {
  display: none;
}

.page-surface-card.is-missing .page-surface-missing {
  display: grid;
}

.page-surface-card-copy {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
}

.page-surface-card-copy > strong {
  color: #f3f6f1;
  font-size: 13px;
  line-height: 1.35;
  text-wrap: pretty;
}

.page-surface-card-copy > p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-surface-card-id {
  display: flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.1);
  background: rgba(225, 242, 226, 0.025);
}

.page-surface-card-id b,
.page-surface-card-id span,
.page-surface-card-id em {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 9px;
  font-style: normal;
  line-height: 1;
  white-space: nowrap;
}

.page-surface-card-id b {
  background: var(--lime);
  color: #071000;
  font-family: var(--mono);
  font-weight: 900;
}

.page-surface-card-id span {
  border: 1px solid rgba(225, 242, 226, 0.14);
  color: #dfe6df;
}

.page-surface-card-id em {
  margin-left: auto;
  background: rgba(208, 255, 66, 0.07);
  color: var(--lime);
}

.page-surface-card-id em.status-pending,
.page-surface-card-id em.status-paused {
  color: #ffc36f;
  background: rgba(255, 195, 111, 0.08);
}

.page-surface-card-copy dl {
  display: grid;
  gap: 4px;
  margin: 1px 0 0;
}

.page-surface-card-copy dl div {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 6px;
}

.page-surface-card-copy dt,
.page-surface-card-copy dd {
  margin: 0;
  font-size: 10px;
  line-height: 1.4;
}

.page-surface-card-copy dt {
  color: rgba(225, 242, 226, 0.48);
}

.page-surface-card-copy dd {
  min-width: 0;
  color: #cfd8cf;
  overflow-wrap: anywhere;
}

.page-surface-flow-link {
  justify-self: start;
  min-height: 28px;
  margin-top: 2px;
  padding: 0 9px;
  border: 1px solid rgba(208, 255, 66, 0.32);
  border-radius: var(--control-radius);
  background: transparent;
  color: var(--lime);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.page-surface-flow-link:hover,
.page-surface-flow-link:focus-visible {
  border-color: rgba(208, 255, 66, 0.72);
  background: rgba(208, 255, 66, 0.08);
  outline: none;
}

@media (max-width: 1500px) {
  .page-surface-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1040px) {
  .page-surface-catalog-head {
    display: grid;
  }

  .page-surface-catalog-head dl {
    justify-content: flex-start;
  }

  .page-surface-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .page-surface-grid {
    grid-template-columns: 1fr;
  }
}

.mini-flow-diagram {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.1);
}

.mini-flow-diagram-title,
.mini-flow-node-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-flow-diagram-title strong,
.mini-flow-node-title strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
}

.mini-flow-diagram-title span,
.mini-flow-node-title span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.mini-flow-board {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.mini-flow-column {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  align-content: start;
  overflow: hidden;
  border: 1px solid rgba(225, 242, 226, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.24);
}

.mini-flow-column:hover,
.mini-flow-column.active {
  border-color: rgba(208, 255, 66, 0.34);
  background: rgba(208, 255, 66, 0.04);
}

.mini-flow-column.active {
  border-color: rgba(208, 255, 66, 0.72);
}

.mini-flow-column-head {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 16px;
  border-right: 1px solid rgba(225, 242, 226, 0.1);
  background: rgba(208, 255, 66, 0.075);
}

.mini-flow-column-head span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

.mini-flow-column-head strong {
  color: var(--lime);
  font-size: 15px;
  line-height: 1.28;
}

.mini-flow-column-head em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.mini-flow-column-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.mini-flow-column-body {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  padding: 14px 14px 18px;
  scrollbar-color: rgba(208, 255, 66, 0.38) transparent;
}

.mini-flow-state-pairs {
  align-items: stretch;
  scroll-snap-type: x proximity;
}

.mini-flow-state-pair {
  display: grid;
  width: 488px;
  flex: 0 0 488px;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(225, 242, 226, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  scroll-snap-align: start;
}

.mini-flow-state-pair-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.mini-flow-state-pair-head > span {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
}

.mini-flow-state-pair-head > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-flow-motion-status {
  padding: 4px 7px;
  border: 1px solid rgba(225, 242, 226, 0.14);
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.mini-flow-motion-status.is-locked {
  border-color: rgba(208, 255, 66, 0.42);
  color: var(--lime);
}

.mini-flow-motion-status.is-preview {
  border-color: rgba(255, 205, 84, 0.42);
  color: #ffd96b;
}

.mini-flow-motion-status.is-pending {
  border-style: dashed;
}

.mini-flow-state-track {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.mini-flow-state-track .mini-flow-screen {
  width: 160px;
  flex-basis: 160px;
}

.mini-flow-state-track .mini-flow-action {
  width: 104px;
  flex-basis: 104px;
  margin-top: 145px;
}

.mini-flow-no-target {
  display: grid;
  width: 274px;
  min-height: 348px;
  flex: 0 0 274px;
  place-content: center;
  justify-items: center;
  gap: 8px;
  border: 1px dashed rgba(225, 242, 226, 0.16);
  border-radius: 8px;
  background: #050807;
  text-align: center;
}

.mini-flow-no-target span,
.mini-flow-no-target em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.mini-flow-no-target strong {
  color: var(--lime);
  font-size: 15px;
}

.mini-flow-state-copy {
  min-height: 34px;
  margin: 0;
  padding: 8px 10px;
  border-left: 2px solid rgba(208, 255, 66, 0.62);
  color: #e9eee9;
  font-size: 12px;
  line-height: 1.45;
}

.mini-flow-screen {
  display: grid;
  width: 190px;
  flex: 0 0 190px;
  gap: 8px;
  margin: 0;
}

.mini-flow-screen[data-rule-id] {
  cursor: pointer;
}

.mini-flow-screen.active .mini-flow-screen-media,
.mini-flow-screen[data-rule-id]:hover .mini-flow-screen-media,
.mini-flow-screen[data-rule-id]:focus-visible .mini-flow-screen-media {
  border-color: rgba(208, 255, 66, 0.72);
  box-shadow: 0 0 0 2px rgba(208, 255, 66, 0.12);
}

.mini-flow-screen-media {
  position: relative;
  width: 100%;
  aspect-ratio: 440 / 956;
  border: 1px solid rgba(208, 255, 66, 0.24);
  border-radius: 8px;
  background: #050807;
  overflow: hidden;
}

.mini-flow-screen-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #000;
}

.mini-flow-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mini-flow-pin {
  position: absolute;
  left: var(--pin-x);
  top: var(--pin-y);
  display: inline-flex;
  min-width: 34px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: var(--control-radius);
  background: var(--lime);
  color: #061000;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.mini-flow-placeholder {
  display: none;
  height: 100%;
  place-items: center;
  gap: 6px;
  padding: 18px;
  text-align: center;
}

.mini-flow-placeholder strong {
  color: var(--lime);
  font-size: 15px;
}

.mini-flow-placeholder span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.mini-flow-screen.is-missing .mini-flow-screen-media img,
.mini-flow-screen.is-missing .mini-flow-pins {
  display: none;
}

.mini-flow-screen.is-missing .mini-flow-placeholder {
  display: grid;
}

.mini-flow-screen figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mini-flow-screen figcaption strong {
  flex: 0 0 auto;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 11px;
}

.mini-flow-screen figcaption span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-flow-action {
  display: grid;
  width: 104px;
  min-height: 52px;
  flex: 0 0 104px;
  grid-template-rows: auto auto;
  place-content: center;
  justify-items: center;
  gap: 2px;
  margin-top: 174px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid rgba(208, 255, 66, 0.28);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}

.mini-flow-action-verb {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.mini-flow-action-name {
  display: block;
  max-width: 100%;
  color: var(--lime);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.mini-flow-action-name.is-long {
  font-size: 11px;
}

.mini-flow-branch-reset {
  display: grid;
  width: 104px;
  min-height: 52px;
  flex: 0 0 104px;
  place-content: center;
  justify-items: center;
  gap: 2px;
  margin-top: 174px;
  padding: 7px 10px;
  border: 1px dashed rgba(208, 255, 66, 0.36);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.mini-flow-branch-reset small,
.mini-flow-existing-target small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.mini-flow-branch-reset b,
.mini-flow-existing-target b {
  display: block;
  max-width: 84px;
  overflow: hidden;
  color: var(--lime);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-flow-existing-target {
  display: grid;
  width: 104px;
  min-height: 52px;
  flex: 0 0 104px;
  place-content: center;
  justify-items: center;
  gap: 2px;
  margin-top: 174px;
  padding: 7px 10px;
  border: 1px solid rgba(225, 242, 226, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
}

.mini-flow-action:hover,
.mini-flow-action:focus-visible {
  border-color: rgba(208, 255, 66, 0.64);
  background: rgba(208, 255, 66, 0.1);
  outline: none;
}

.mini-flow-column-fields {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(225, 242, 226, 0.1);
  padding: 10px 12px 12px;
}

@media (max-width: 860px) {
  .mini-flow-column {
    grid-template-columns: 1fr;
  }

  .mini-flow-column-head {
    border-right: 0;
    border-bottom: 1px solid rgba(225, 242, 226, 0.1);
  }
}

.mini-flow-column-fields summary,
.mini-flow-fields summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-flow-field-list {
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.mini-flow-field-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(225, 242, 226, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
}

.mini-flow-field-card b {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 11px;
}

.mini-flow-field-card span {
  min-width: 0;
  overflow: hidden;
  color: #edf3ed;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-flow-field-card em {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-flow-field-card:hover,
.mini-flow-field-card:focus-visible,
.mini-flow-field-card.active {
  border-color: rgba(208, 255, 66, 0.58);
  background: rgba(208, 255, 66, 0.075);
}

.mini-flow-fields {
  padding: 0 18px 18px;
}

.mini-flow-node-section {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
}

.mini-flow-table-wrap {
  overflow-x: auto;
}

.mini-flow-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.mini-flow-table th,
.mini-flow-table td {
  padding: 10px 11px;
  color: #dfe6df;
  font-size: 12px;
  line-height: 1.42;
  text-align: left;
  vertical-align: middle;
}

.mini-flow-table th {
  border-top: 1px solid rgba(208, 255, 66, 0.32);
  border-bottom: 1px solid rgba(208, 255, 66, 0.32);
  background: rgba(208, 255, 66, 0.09);
  color: var(--muted);
  font-weight: 800;
}

.mini-flow-table th:first-child,
.mini-flow-table td:first-child {
  border-left: 1px solid rgba(225, 242, 226, 0.1);
  border-radius: 12px 0 0 12px;
}

.mini-flow-table th:last-child,
.mini-flow-table td:last-child {
  border-right: 1px solid rgba(225, 242, 226, 0.1);
  border-radius: 0 12px 12px 0;
}

.mini-flow-table td {
  border-top: 1px solid rgba(225, 242, 226, 0.1);
  border-bottom: 1px solid rgba(225, 242, 226, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.mini-flow-table tr.active td,
.mini-flow-table tr:hover td {
  border-color: rgba(208, 255, 66, 0.5);
  background: rgba(208, 255, 66, 0.07);
}

.mini-node-select {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(208, 255, 66, 0.42);
  border-radius: var(--control-radius);
  background: rgba(208, 255, 66, 0.08);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
}

.page-flow-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  list-style: none;
}

.page-flow-item {
  position: relative;
  margin: 0;
}

.page-flow-item:not(:last-child)::after {
  position: absolute;
  left: 18px;
  top: calc(100% - 2px);
  width: 1px;
  height: 14px;
  background: rgba(208, 255, 66, 0.32);
  content: "";
}

.page-flow-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(225, 242, 226, 0.12);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  text-align: left;
}

.page-flow-card:hover,
.page-flow-card:focus-visible,
.page-flow-card.active {
  border-color: rgba(208, 255, 66, 0.62);
  background: rgba(208, 255, 66, 0.075);
}

.page-flow-index {
  display: inline-grid;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(208, 255, 66, 0.45);
  border-radius: 50%;
  place-items: center;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
}

.page-flow-main {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.page-flow-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-flow-title-line strong {
  min-width: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.24;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-flow-title-line .value-sheet-status {
  flex: 0 0 auto;
}

.page-flow-field {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  color: #d7ddd8;
  font-size: 13px;
  line-height: 1.44;
}

.page-flow-field em {
  color: var(--muted);
  font-style: normal;
  font-weight: 760;
}

.page-flow-field b {
  min-width: 0;
  color: #eef4ee;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.reward-tab,
.reward-filter-tab {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
}

.reward-tab:hover,
.reward-tab:focus-visible,
.reward-filter-tab:hover,
.reward-filter-tab:focus-visible {
  border-color: rgba(208, 255, 66, 0.56);
  color: var(--lime);
}

.reward-tab.active,
.reward-filter-tab.active {
  border-color: var(--lime);
  background: var(--lime);
  color: #061000;
}

.reward-tab span,
.reward-filter-tab span {
  font-family: var(--mono);
}

.medal-category-title {
  grid-template-columns: minmax(0, 1fr) auto;
  pointer-events: none;
}

.medal-category-title::before {
  content: none;
}

.medal-subgroup-list {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.medal-subgroup {
  display: grid;
  gap: 7px;
}

.medal-subgroup-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.medal-subgroup-title strong {
  color: var(--lime);
  font-size: 13px;
  line-height: 1.25;
}

.medal-subgroup-title span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.medal-subgroup .feature-rules {
  padding: 0;
}

.boundary-groups {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
  animation: revealRules 160ms ease-out;
}

.boundary-group {
  padding: 11px;
  border: 1px solid rgba(225, 242, 226, 0.12);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.boundary-group h4 {
  margin: 0 0 7px;
  color: var(--lime);
  font-size: 13px;
  line-height: 1.3;
}

.boundary-group ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: #d7ddd8;
  font-size: 12px;
  line-height: 1.45;
}

@keyframes revealRules {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.system-group {
  min-width: 0;
}

.system-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(208, 255, 66, 0.2);
  border-radius: 16px;
  background: rgba(208, 255, 66, 0.08);
}

.system-group-title h3 {
  margin: 0;
  color: var(--lime);
  font-size: 16px;
  line-height: 1.2;
}

.system-group-title span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.system-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  min-width: 0;
}

.page-column,
.system-column {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.page-title {
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid rgba(208, 255, 66, 0.34);
  border-radius: 16px;
  background: rgba(208, 255, 66, 0.13);
  color: var(--lime);
  font-size: 18px;
  font-weight: 860;
  text-align: center;
}

.tree-title-button {
  width: 100%;
}

.tree-title-button:hover,
.tree-title-button:focus-visible {
  border-color: var(--lime);
  background: rgba(208, 255, 66, 0.2);
}

.module-card {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.module-card::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -13px;
  width: 1px;
  height: 12px;
  background: var(--line);
}

.module-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.module-title strong {
  font-size: 15px;
}

.module-title span {
  color: var(--muted);
  font-size: 11px;
}

.node-list {
  display: grid;
  gap: 7px;
}

.rule-node {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid rgba(225, 242, 226, 0.12);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.rule-node:hover,
.rule-node:focus-visible,
.rule-node.active {
  border-color: var(--lime);
  background: rgba(208, 255, 66, 0.09);
}

.rule-node.deprecated {
  border-color: rgba(255, 215, 97, 0.46);
}

.rule-node strong,
.rule-node span,
.rule-node small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.rule-node strong {
  font-size: 13px;
  line-height: 1.25;
}

.rule-node span {
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.25;
}

.rule-node small {
  margin-top: 4px;
  color: #c4ccc5;
  font-size: 11px;
  line-height: 1.3;
}

.rule-node .deprecated-mark {
  color: var(--warning);
  font-family: inherit;
  font-weight: 800;
}

.node-status {
  display: inline-flex !important;
  align-items: center;
  width: fit-content;
  min-height: 18px;
  margin: 0 0 0 4px !important;
  padding: 0 6px;
  border: 1px solid rgba(208, 255, 66, 0.28);
  border-radius: var(--control-radius);
  font-family: inherit !important;
  font-size: 10px !important;
  line-height: 1;
  color: var(--lime) !important;
  vertical-align: 1px;
}

.detail-panel {
  position: sticky;
  top: 18px;
  display: flex;
  height: calc(100vh - 36px);
  max-height: calc(100vh - 36px);
  overflow: hidden;
}

.detail-content {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.detail-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.detail-panel-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  flex: 0 0 auto;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.16);
  background:
    linear-gradient(180deg, rgba(18, 25, 23, 0.98), rgba(10, 15, 13, 0.98)),
    var(--panel);
}

.detail-title-block {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.detail-title-block h2 {
  margin: 0;
  color: var(--text);
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 20px;
  line-height: 1.18;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.detail-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: max-content;
}

.detail-title-actions .small-action,
.detail-title-actions .primary-action {
  min-height: 34px;
  height: 34px;
  margin: 0;
  padding: 0 14px;
  white-space: nowrap;
}

.detail-title-actions .primary-action {
  width: auto;
  min-width: 72px;
  border-color: var(--lime);
  background: var(--lime);
  color: #071000;
}

.detail-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 18px;
  scrollbar-gutter: stable;
}

.xp-compact-form .detail-panel-header {
  padding: 13px 14px 11px;
}

.xp-compact-form .detail-title-block h2 {
  font-size: 19px;
}

.xp-compact-body {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
}

.xp-compact-body label {
  display: grid;
  gap: 7px;
}

.xp-compact-body label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.xp-compact-body input,
.xp-compact-body textarea,
.xp-compact-body select {
  width: 100%;
}

.xp-compact-body input[readonly] {
  border-color: rgba(208, 255, 66, 0.24);
  background: rgba(208, 255, 66, 0.055);
  color: var(--lime);
  cursor: default;
}

.detail-empty {
  display: grid;
  min-height: 520px;
  padding: 18px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.detail-head {
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-head--planning {
  gap: 8px;
}

.detail-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.18;
}

.detail-meta-line {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.detail-form-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 10px;
  flex: 0 0 auto;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(225, 242, 226, 0.14);
  background:
    linear-gradient(180deg, rgba(10, 15, 13, 0.98), rgba(7, 11, 9, 0.98)),
    var(--panel);
}

.detail-form-actions .small-action,
.detail-form-actions .primary-action {
  width: 100%;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0 12px;
  white-space: nowrap;
}

.detail-form-actions .primary-action {
  border-color: var(--lime);
  background: var(--lime);
  color: #071000;
  font-weight: 900;
}

.detail-id {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(208, 255, 66, 0.38);
  border-radius: var(--control-radius);
  color: var(--lime);
  font-size: 12px;
  font-weight: 760;
}

.status-badge.deprecated {
  border-color: rgba(255, 215, 97, 0.48);
  color: var(--warning);
}

.status-active {
  border-color: rgba(208, 255, 66, 0.28);
  background: rgba(208, 255, 66, 0.06);
  color: #c9f67a !important;
}

.status-pending {
  border-color: rgba(255, 215, 97, 0.48);
  background: rgba(255, 215, 97, 0.1);
  color: var(--warning) !important;
}

.status-paused {
  border-color: rgba(255, 185, 72, 0.52);
  background: rgba(255, 185, 72, 0.1);
  color: #ffc36f !important;
}

.status-mock {
  border-color: rgba(255, 160, 72, 0.52);
  background: rgba(255, 160, 72, 0.1);
  color: #ffb05f !important;
}

.status-deprecated,
.status-badge.deprecated {
  border-color: rgba(255, 98, 90, 0.42);
  background: rgba(255, 98, 90, 0.09);
  color: #ff9b94 !important;
}

.status-draft {
  border-color: rgba(225, 242, 226, 0.24);
  color: var(--muted) !important;
}

.value-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 14px;
}

.value-hero.single {
  grid-template-columns: 1fr;
}

.value-hero div,
.detail-row {
  border: 1px solid rgba(225, 242, 226, 0.12);
  background: rgba(255, 255, 255, 0.035);
}

.value-hero div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
}

.value-hero span,
.detail-row span,
.log-meta span {
  color: var(--muted);
  font-size: 12px;
}

.value-hero strong {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 21px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.detail-list {
  display: grid;
  gap: 9px;
}

.detail-section {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.detail-section h3 {
  margin: 0;
  color: var(--lime);
  font-size: 15px;
  line-height: 1.3;
}

.detail-row {
  display: grid;
  gap: 5px;
  padding: 11px;
  border-radius: 14px;
}

.detail-row strong,
.detail-row p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.recent-change-list {
  display: grid;
  gap: 8px;
}

.recent-change-item {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(225, 242, 226, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.recent-change-item span {
  color: var(--muted);
  font-size: 12px;
}

.recent-change-item strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.developer-info {
  margin-top: 14px;
  border: 1px solid rgba(225, 242, 226, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.developer-info summary {
  min-height: 42px;
  padding: 11px 12px;
  color: var(--muted);
  font-weight: 760;
  cursor: pointer;
}

.developer-info[open] summary {
  color: var(--lime);
}

.developer-info .detail-list {
  padding: 0 10px 10px;
}

.raw-json-row pre {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  color: #d8ded9;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.system-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}

.system-summary-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(225, 242, 226, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.system-summary-grid strong {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 22px;
}

.system-summary-grid span {
  color: var(--muted);
  font-size: 12px;
}

.summary-feature-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.small-action {
  min-height: 34px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 720;
}

.edit-form {
  display: grid;
  gap: 12px;
}

.edit-form.edit-detail-form {
  display: flex;
  gap: 0;
}

.edit-form h2 {
  margin: 0;
  font-size: 22px;
}

.edit-form input,
.edit-form select,
.edit-form textarea {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 12px;
}

.edit-form textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.45;
}

.edit-form .reason-field textarea {
  border-color: rgba(208, 255, 66, 0.5);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.table-category-tabs,
.table-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.table-category-tab {
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.table-category-tab span {
  margin-left: 6px;
  color: inherit;
  font-family: var(--mono);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.16);
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.1);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

td {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: rgba(208, 255, 66, 0.06);
}

.table-id {
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
}

.table-value {
  color: var(--lime);
  font-family: var(--mono);
  font-weight: 800;
}

.table-edit-action {
  min-height: 30px;
  padding: 0 11px;
}

.log-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.log-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.log-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.log-diff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.log-diff div {
  min-width: 0;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.log-diff span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.log-diff strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px dashed rgba(225, 242, 226, 0.18);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  min-height: 120px;
  padding: 12px;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 48px));
  padding: 12px 14px;
  border: 1px solid rgba(208, 255, 66, 0.55);
  border-radius: 14px;
  background: #0b100d;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace.workspace-medal-board {
    grid-template-columns: 1fr;
  }

  .sidebar-panel,
  .primary-panel,
  .detail-panel {
    min-height: auto;
  }

  .sidebar-panel,
  .detail-panel {
    position: static;
    max-height: none;
  }

  .sidebar-system-nav {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 1180px) {
  .rules-app {
    width: min(100vw - 24px, 100%);
    margin: 12px auto;
    padding: 14px;
  }

  .top-shell,
  .workspace,
  .status-strip {
    grid-template-columns: 1fr;
  }

  .top-controls {
    justify-content: flex-start;
  }

  .detail-panel {
    position: static;
    max-height: none;
  }

  .view-tabs {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .tree-grid {
    grid-template-columns: repeat(5, 220px);
  }

  .system-grid {
    display: block;
  }

  .system-editor-stack {
    grid-template-columns: 1fr;
  }

  .system-group {
    margin-bottom: 16px;
  }

  .system-group-grid {
    grid-template-columns: repeat(3, 240px);
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .page-reference-card {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  }
}

@media (max-width: 720px) {
  .login-shell {
    padding: 14px;
  }

  .rules-app {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .title-group,
  .panel-heading,
  .log-diff,
  .value-hero,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .title-group,
  .panel-heading {
    display: grid;
  }

  .top-shell {
    padding: 16px;
  }

  .search-box {
    grid-template-columns: 1fr;
    height: auto;
    padding: 10px 14px;
  }

  .search-box input {
    padding-left: 0;
  }

  .view-tabs,
  .sidebar-system-nav {
    grid-template-columns: 1fr;
  }

  .system-summary-grid,
  .log-diff {
    grid-template-columns: 1fr;
  }

  .page-reference-card {
    grid-template-columns: 1fr;
  }

  .page-reference-copy {
    padding-top: 0;
  }

  .page-reference-media {
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

.medal-image-thumb,
.medal-image-editor-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(190, 255, 0, 0.34);
  background: #050806;
  color: #f0c24b;
}

.medal-image-thumb {
  width: 96px;
  height: 96px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.medal-image-thumb:hover,
.medal-image-thumb:focus-visible {
  outline: 1px solid rgba(208, 255, 66, 0.72);
  outline-offset: 4px;
}

.medal-sheet-panel .value-sheet-cell--center {
  justify-self: center;
  text-align: center;
}

.medal-image-thumb img,
.medal-image-editor-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rules-medal-artwork {
  filter: var(--ttmiao-medal-white-rim);
}

.medal-image-thumb .rules-medal-artwork,
.medal-image-editor-preview .rules-medal-artwork,
.home-touch-thumb .rules-medal-artwork,
.dev-viewer-film .rules-medal-artwork {
  filter: var(--ttmiao-medal-white-rim-compact);
}

.medal-image-missing {
  color: #f0a43c;
  font-size: 12px;
}

/* Medal planning board: scoped to the medal rules middle panel. */
.medal-planning-board {
  position: relative;
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(208, 255, 66, 0.22);
  border-radius: 16px;
  background-color: #070b09;
  background-image:
    linear-gradient(30deg, rgba(208, 255, 66, 0.026) 12%, transparent 12.5%, transparent 87%, rgba(208, 255, 66, 0.026) 87.5%),
    linear-gradient(150deg, rgba(208, 255, 66, 0.026) 12%, transparent 12.5%, transparent 87%, rgba(208, 255, 66, 0.026) 87.5%),
    linear-gradient(30deg, rgba(208, 255, 66, 0.026) 12%, transparent 12.5%, transparent 87%, rgba(208, 255, 66, 0.026) 87.5%);
  background-position: 0 0, 0 0, 32px 56px;
  background-size: 64px 112px;
}

.medal-planning-board::before {
  content: "";
  position: absolute;
  inset: 0 16px auto;
  height: 2px;
  background: var(--lime);
  opacity: 0.88;
}

.medal-planning-summary {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  gap: 8px;
  padding-top: 8px;
}

.medal-planning-summary div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(225, 242, 226, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.medal-planning-summary strong {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
}

.medal-planning-summary span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.medal-big-series-list,
.medal-small-series-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.medal-big-series {
  display: grid;
  gap: 10px;
  min-width: 0;
  scroll-margin-top: 18px;
}

.medal-big-series + .medal-big-series {
  margin-top: 8px;
}

.medal-empty-series {
  display: grid;
  place-items: center;
  min-height: 104px;
  border: 1px dashed rgba(208, 255, 66, 0.22);
  border-radius: 12px;
  background: rgba(208, 255, 66, 0.025);
  color: var(--muted);
  font-size: 12px;
}

.medal-big-series-header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 5px 14px 5px 6px;
  border: 1px solid rgba(208, 255, 66, 0.58);
  border-radius: 12px;
  background: rgba(208, 255, 66, 0.07);
}

.medal-big-series-header > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--lime);
  color: #071000;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 950;
}

.medal-big-series-header h3 {
  margin: 0;
  color: var(--lime);
  font-size: 19px;
  line-height: 1.2;
}

.medal-big-series-header em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.medal-small-series {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(225, 242, 226, 0.13);
  border-radius: 12px;
  background: rgba(8, 13, 10, 0.9);
}

.medal-small-series-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 10px 6px;
  border-right: 1px solid rgba(208, 255, 66, 0.2);
  background: rgba(208, 255, 66, 0.045);
}

.medal-series-code {
  color: rgba(208, 255, 66, 0.72);
  font-family: var(--mono);
  font-size: 11px;
}

.medal-small-series-info h4 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
  writing-mode: vertical-rl;
  text-orientation: upright;
}

.medal-small-series-info p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.medal-design-progress,
.medal-series-rule-status,
.medal-rule-status,
.medal-art-status,
.medal-xp-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 8px;
  border-radius: var(--control-radius);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
}

.medal-small-series-info .medal-design-progress,
.medal-small-series-info .medal-series-rule-status {
  justify-content: center;
  max-width: 100%;
  min-height: 18px;
  padding: 2px 5px;
  font-size: 8px;
  text-align: center;
  white-space: normal;
}

.medal-design-progress {
  margin-top: auto;
  border: 1px solid rgba(255, 190, 77, 0.38);
  background: rgba(255, 190, 77, 0.09);
  color: #ffc56d;
}

.medal-design-progress.complete {
  border-color: rgba(208, 255, 66, 0.5);
  background: rgba(208, 255, 66, 0.11);
  color: var(--lime);
}

.medal-series-rule-status {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.medal-card-grid {
  display: grid;
  grid-template-columns: repeat(var(--medal-columns, 1), minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 3px;
  min-width: 0;
  padding: 5px;
}

.medal-planning-card {
  display: grid;
  grid-template-rows: minmax(58px, auto) auto 28px;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 6px 4px;
  border: 1px solid rgba(225, 242, 226, 0.11);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.34);
  color: var(--text);
  cursor: pointer;
}

.medal-planning-card:hover,
.medal-planning-card:focus-visible,
.medal-planning-card.active {
  border-color: rgba(208, 255, 66, 0.7);
  background: rgba(208, 255, 66, 0.065);
  outline: none;
}

.medal-planning-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  text-align: center;
}

.medal-planning-card-header .share-reward-frequency {
  font-size: 10px;
  margin-top: 4px;
}

.medal-trigger-condition {
  display: block;
  min-width: 0;
  max-width: 100%;
  color: rgba(245, 248, 244, 0.78);
  font-size: 10px;
  font-weight: 720;
  line-height: 1.35;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.medal-planning-art {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  width: 100%;
  aspect-ratio: 3 / 4;
}

.medal-planning-image {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 3 / 4;
  overflow: visible;
}

.medal-planning-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: var(--ttmiao-medal-white-rim);
}

.medal-planning-image img.medal-art-normalized {
  position: absolute;
  max-width: none;
  object-fit: fill;
}

.medal-planning-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  width: 82px;
  height: 82px;
  border: 1px dashed rgba(208, 255, 66, 0.32);
  border-radius: 50%;
  background: rgba(208, 255, 66, 0.025);
  color: rgba(208, 255, 66, 0.55);
}

.medal-planning-placeholder b {
  font-size: 22px;
  font-weight: 350;
  line-height: 1;
}

.medal-planning-placeholder em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.medal-planning-card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.medal-planning-card-footer .medal-xp-pill,
.medal-planning-card-footer .medal-rule-status,
.medal-planning-card-footer .medal-art-status {
  min-height: 18px;
  padding: 0 6px;
  font-size: 9px;
}

.medal-planning-card-footer .medal-xp-pill {
  margin: 0;
}

.medal-xp-pill {
  margin-right: auto;
  background: var(--lime);
  color: #071000;
  font-family: var(--mono);
}

.medal-rule-status {
  border: 1px solid rgba(208, 255, 66, 0.34);
  background: rgba(208, 255, 66, 0.09);
  color: var(--lime);
}

.medal-rule-status.status-pending,
.medal-series-rule-status.status-pending {
  border-color: rgba(255, 160, 72, 0.44);
  background: rgba(255, 160, 72, 0.1);
  color: #ffb05f;
}

.medal-rule-status.status-paused,
.medal-series-rule-status.status-paused {
  border-color: rgba(255, 185, 72, 0.44);
  background: rgba(255, 185, 72, 0.1);
  color: #ffc36f;
}

.medal-art-status {
  color: #ffc56d;
  background: rgba(255, 190, 77, 0.08);
}

.medal-art-status.complete {
  color: var(--lime);
  background: rgba(208, 255, 66, 0.08);
}

@media (max-width: 1500px) {
  .medal-planning-summary {
    grid-template-columns: repeat(3, minmax(92px, 1fr));
  }

  .medal-card-grid {
    grid-template-columns: repeat(var(--medal-columns, 1), minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .medal-planning-board {
    padding: 12px;
  }

  .medal-small-series {
    grid-template-columns: 1fr;
  }

  .medal-small-series-info {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid rgba(208, 255, 66, 0.2);
  }

  .medal-small-series-info h4 {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
  }

  .medal-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .medal-small-series-info p,
  .medal-series-rule-status {
    grid-column: 2;
  }

  .medal-design-progress {
    grid-column: 3;
    grid-row: 1 / span 2;
    margin-top: 0;
  }
}

@media (max-width: 560px) {
  .medal-planning-summary {
    grid-template-columns: repeat(2, minmax(92px, 1fr));
  }

  .medal-big-series-header {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .medal-big-series-header em {
    grid-column: 2;
    white-space: normal;
  }

  .medal-card-grid {
    grid-template-columns: 1fr;
  }
}

.medal-image-editor {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.medal-image-editor > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.medal-image-editor-preview {
  width: 112px;
  height: 112px;
  padding: 8px;
  border-radius: 10px;
}

.medal-image-editor-preview.missing {
  border-style: dashed;
  color: #f0a43c;
}

.medal-image-editor > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.medal-image-upload {
  cursor: pointer;
}
/* Page snapshots open the viewer; node editing remains a separate control. */
.mini-flow-screen .mini-flow-preview { display: block; width: 100%; padding: 0; color: inherit; font: inherit; text-align: left; cursor: zoom-in; }
.mini-flow-screen .mini-flow-preview:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.mini-flow-screen .mini-flow-edit-node { margin-left: auto; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--lime); background: transparent; font-size: 11px; white-space: nowrap; }
