/* Neutral premium layer shared by light and dark themes. */
html[data-resolved-theme="light"] body,
html[data-resolved-theme="light"] body[data-view="board"] {
  color: #182027;
  background: #b8c1c5;
  background-image: none;
}

html[data-resolved-theme="light"] {
  --ink: #151d24;
  --ink-2: #26323b;
  --muted: #53616b;
  --muted-2: #6b7881;
  --line: rgba(22, 35, 44, 0.17);
  --line-strong: rgba(22, 35, 44, 0.28);
  --paper: #dfe5e7;
  --paper-soft: #d3dade;
  --canvas: #b8c1c5;
}

html[data-resolved-theme="light"] .workspace,
html[data-resolved-theme="light"] body[data-view="board"] .workspace,
html[data-resolved-theme="light"] body[data-view="board"] .board-panel,
html[data-resolved-theme="light"] body[data-view="board"] .linux-board-scene {
  background: transparent;
  background-image: none;
}

html[data-resolved-theme="light"] .panel,
html[data-resolved-theme="light"] .overview-hero,
html[data-resolved-theme="light"] .metric-card,
html[data-resolved-theme="light"] .table-shell,
html[data-resolved-theme="light"] .referral-result {
  border-color: rgba(20, 34, 43, 0.17);
  color: #182027;
  background: rgba(207, 215, 219, 0.88) !important;
  box-shadow: 0 18px 44px rgba(22, 34, 43, 0.16), inset 0 1px rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(22px) saturate(1.05);
}

html[data-resolved-theme="light"] .overview-hero {
  background-image: none !important;
}

html[data-resolved-theme="light"] .metric-card.pink,
html[data-resolved-theme="light"] .metric-card.green,
html[data-resolved-theme="light"] .metric-card.gold,
html[data-resolved-theme="light"] .metric-card.neutral {
  background: rgba(215, 222, 225, 0.9) !important;
}

html[data-resolved-theme="light"] .metric-card strong,
html[data-resolved-theme="light"] .metric-card h3,
html[data-resolved-theme="light"] .metric-card h4,
html[data-resolved-theme="light"] .panel h3,
html[data-resolved-theme="light"] .panel-header h3,
html[data-resolved-theme="light"] .overview-profile h3,
html[data-resolved-theme="light"] td,
html[data-resolved-theme="light"] .referral-link-main,
html[data-resolved-theme="light"] .party-name strong {
  color: #151d24;
}

html[data-resolved-theme="light"] .metric-label,
html[data-resolved-theme="light"] .metric-card small,
html[data-resolved-theme="light"] .panel-header p,
html[data-resolved-theme="light"] .overview-profile p,
html[data-resolved-theme="light"] .muted-text,
html[data-resolved-theme="light"] th,
html[data-resolved-theme="light"] .notification-row small,
html[data-resolved-theme="light"] .notification-row time,
html[data-resolved-theme="light"] .referral-link-meta,
html[data-resolved-theme="light"] .party-name small {
  color: #53616b;
}

html[data-resolved-theme="light"] input,
html[data-resolved-theme="light"] select,
html[data-resolved-theme="light"] textarea,
html[data-resolved-theme="light"] .language-select,
html[data-resolved-theme="light"] .profile-details > div,
html[data-resolved-theme="light"] .panel .board-meta div,
html[data-resolved-theme="light"] .overview-hero .board-meta div,
html[data-resolved-theme="light"] .notification-row,
html[data-resolved-theme="light"] .referral-link-row {
  border-color: rgba(22, 35, 44, 0.16);
  color: #182027;
  background: rgba(225, 230, 232, 0.76) !important;
  background-image: none !important;
}

html[data-resolved-theme="light"] input::placeholder,
html[data-resolved-theme="light"] textarea::placeholder {
  color: #68757e;
}

html[data-resolved-theme="light"] .table-shell {
  background: rgba(204, 212, 216, 0.84) !important;
}

html[data-resolved-theme="light"] thead,
html[data-resolved-theme="light"] thead tr,
html[data-resolved-theme="light"] th {
  background: rgba(187, 197, 202, 0.72) !important;
}

html[data-resolved-theme="light"] td,
html[data-resolved-theme="light"] th {
  border-color: rgba(22, 35, 44, 0.13);
}

html[data-resolved-theme="light"] .secondary-action,
html[data-resolved-theme="light"] .ghost-action,
html[data-resolved-theme="light"] .table-action,
html[data-resolved-theme="light"] .icon-action,
html[data-resolved-theme="light"] .refresh-action {
  border-color: rgba(22, 35, 44, 0.17);
  color: #26323b;
  background: rgba(222, 228, 230, 0.76);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.45);
}

html[data-resolved-theme="light"] body[data-view="board"] .board-game-bar,
html[data-resolved-theme="light"] body[data-view="board"] .board-system-hud.board-control-deck,
html[data-resolved-theme="light"] body[data-view="board"] .linux-board-scene .position-card,
html[data-resolved-theme="light"] body[data-view="board"] .linux-board-scene .position-card.legend,
html[data-resolved-theme="light"] body[data-view="board"] .linux-board-scene .position-card.left_builder,
html[data-resolved-theme="light"] body[data-view="board"] .linux-board-scene .position-card.right_builder,
html[data-resolved-theme="light"] body[data-view="board"] .linux-board-scene .position-card.empty {
  color: #182027;
  background: rgba(202, 211, 215, 0.84);
  background-image: none;
  border-color: rgba(28, 43, 52, 0.18);
  box-shadow: 0 18px 42px rgba(24, 37, 46, 0.17), inset 0 1px rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(22px) saturate(1.05);
}

html[data-resolved-theme="dark"] body,
html[data-resolved-theme="dark"] body[data-view="board"] {
  background: #0f1215;
  background-image: none;
}

html[data-resolved-theme="dark"] .workspace,
html[data-resolved-theme="dark"] body[data-view="board"] .workspace,
html[data-resolved-theme="dark"] body[data-view="board"] .board-panel,
html[data-resolved-theme="dark"] body[data-view="board"] .linux-board-scene {
  background: transparent;
  background-image: none;
}

html[data-resolved-theme="dark"] .topbar,
html[data-resolved-theme="dark"] .panel,
html[data-resolved-theme="dark"] .overview-hero,
html[data-resolved-theme="dark"] .metric-card,
html[data-resolved-theme="dark"] .table-shell,
html[data-resolved-theme="dark"] .referral-result,
html[data-resolved-theme="dark"] .gift-attention,
html[data-resolved-theme="dark"] .empty-state {
  border-color: rgba(255, 255, 255, 0.085);
  background: rgba(24, 28, 32, 0.56) !important;
  background-image: none !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(24px) saturate(1.04);
}

html[data-resolved-theme="dark"] .overview-hero {
  background: rgba(20, 24, 28, 0.62) !important;
}

html[data-resolved-theme="dark"] .panel::before,
html[data-resolved-theme="dark"] .overview-hero::after {
  opacity: 0.16;
  filter: saturate(0.35);
}

html[data-resolved-theme="dark"] .metric-card.pink,
html[data-resolved-theme="dark"] .metric-card.green,
html[data-resolved-theme="dark"] .metric-card.gold,
html[data-resolved-theme="dark"] .metric-card.neutral {
  border-color: rgba(255, 255, 255, 0.085);
  background: rgba(27, 32, 36, 0.56) !important;
}

html[data-resolved-theme="dark"] .metric-card.pink { border-top-color: rgba(218, 67, 145, 0.32); }
html[data-resolved-theme="dark"] .metric-card.green { border-top-color: rgba(54, 184, 123, 0.3); }
html[data-resolved-theme="dark"] .metric-card.gold { border-top-color: rgba(211, 167, 61, 0.28); }

html[data-resolved-theme="dark"] .metric-card .metric-mark {
  background: #f4f7f6;
  opacity: 0.09;
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.08));
}

html[data-resolved-theme="dark"] .metric-card.pink .metric-mark {
  background: #f08abb;
  opacity: 0.12;
}

html[data-resolved-theme="dark"] .metric-card.green .metric-mark {
  background: #80d9a5;
  opacity: 0.11;
}

html[data-resolved-theme="dark"] .metric-card.gold .metric-mark {
  background: #e5c06d;
  opacity: 0.11;
}

html[data-resolved-theme="dark"] .panel .board-meta div,
html[data-resolved-theme="dark"] .overview-hero .board-meta div,
html[data-resolved-theme="dark"] .notification-row,
html[data-resolved-theme="dark"] .referral-link-row {
  border-color: rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.025) !important;
  background-image: none !important;
}

html[data-resolved-theme="dark"] body[data-view="board"] .board-game-bar,
html[data-resolved-theme="dark"] body[data-view="board"] .board-system-hud.board-control-deck {
  border-color: rgba(255, 255, 255, 0.085);
  background: rgba(22, 27, 31, 0.58);
  background-image: none;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25), inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(24px) saturate(1.04);
}

html[data-resolved-theme="dark"] body[data-view="board"] .board-control-deck .level-pass {
  background: rgba(255, 255, 255, 0.018);
  background-image: none;
}

html[data-resolved-theme="dark"] body[data-view="board"] .linux-board-scene .position-card,
html[data-resolved-theme="dark"] body[data-view="board"] .linux-board-scene .position-card.legend,
html[data-resolved-theme="dark"] body[data-view="board"] .linux-board-scene .position-card.left_builder,
html[data-resolved-theme="dark"] body[data-view="board"] .linux-board-scene .position-card.right_builder,
html[data-resolved-theme="dark"] body[data-view="board"] .linux-board-scene .position-card.empty {
  border-color: rgba(255, 255, 255, 0.095);
  background: rgba(24, 30, 34, 0.58);
  background-image: none;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.27), inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(22px) saturate(1.04);
}

html[data-resolved-theme="dark"] body[data-view="board"] .linux-board-scene .position-card.legend {
  border-color: rgba(218, 67, 145, 0.26);
}

html[data-resolved-theme="dark"] body[data-view="board"] .linux-board-scene .position-card.left_builder {
  border-color: rgba(54, 184, 123, 0.23);
}

html[data-resolved-theme="dark"] body[data-view="board"] .linux-board-scene .position-card.right_builder {
  border-color: rgba(61, 151, 190, 0.23);
}

html[data-resolved-theme="dark"] body[data-view="board"] .linux-board-scene .board-tree .position-user,
html[data-resolved-theme="dark"] body[data-view="board"] .linux-board-scene .board-tree .position-user-button {
  border-color: rgba(255, 255, 255, 0.065);
  background: rgba(8, 12, 15, 0.26);
}

html[data-resolved-theme="dark"] .primary-action {
  background: #bc2b78;
  box-shadow: 0 10px 24px rgba(159, 32, 98, 0.2), inset 0 1px rgba(255, 255, 255, 0.12);
}

html[data-resolved-theme="dark"] .game-board-mark,
html[data-resolved-theme="dark"] .avatar-mini,
html[data-resolved-theme="dark"] .overview-avatar,
html[data-resolved-theme="dark"] .profile-avatar {
  filter: saturate(0.82);
}
.app-header {
  border-bottom: 0;
}

html[data-resolved-theme] body[data-view="board"] .linux-board-scene .board-control-deck {
  border-top: 0 !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22) !important;
}
body[data-view="board"] .linux-board-scene .position-card.legend {
  border-color: color-mix(in srgb, var(--level-accent, #cb217f) 50%, var(--line));
}

body[data-view="board"] .linux-board-scene .position-card.legend::before {
  background: var(--level-accent, #cb217f);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--level-accent, #cb217f) 45%, transparent), 0 0 14px color-mix(in srgb, var(--level-accent, #cb217f) 38%, transparent);
}

body[data-view="board"] .linux-board-scene .position-card.legend .slot-label {
  color: var(--level-accent, #cb217f);
}

body[data-view="board"] .linux-board-scene .position-card.legend.system-recipient {
  background: linear-gradient(135deg, color-mix(in srgb, var(--level-accent, #cb217f) 22%, transparent), color-mix(in srgb, var(--panel) 92%, transparent));
}

/* The configured level color tints a restrained brushed-metal board surface. */
body[data-view="board"] .linux-board-scene[data-metal="start"] { --level-accent: #cb217f; }
body[data-view="board"] .linux-board-scene[data-metal="copper"] { --level-accent: #c47745; }
body[data-view="board"] .linux-board-scene[data-metal="bronze"] { --level-accent: #b7833f; }
body[data-view="board"] .linux-board-scene[data-metal="silver"] { --level-accent: #aeb9c7; }
body[data-view="board"] .linux-board-scene[data-metal="gold"] { --level-accent: #d4ad3d; }
body[data-view="board"] .linux-board-scene[data-metal="platinum"] { --level-accent: #d4e1e5; }
body[data-view="board"] .linux-board-scene[data-metal="diamond"] { --level-accent: #69c9e8; }

html[data-resolved-theme="dark"] body[data-view="board"] .linux-board-scene {
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--level-accent, #cb217f) 25%, transparent), transparent 38%, color-mix(in srgb, var(--level-accent, #cb217f) 13%, transparent) 72%, transparent),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, rgba(0, 0, 0, 0.025) 1px 3px),
    linear-gradient(135deg, #161c20, #0e1316 52%, #171d21) !important;
}

html[data-resolved-theme="light"] body[data-view="board"] .linux-board-scene {
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--level-accent, #cb217f) 24%, transparent), transparent 38%, color-mix(in srgb, var(--level-accent, #cb217f) 14%, transparent) 72%, transparent),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.12) 0 1px, rgba(31, 46, 54, 0.045) 1px 3px),
    linear-gradient(135deg, #aeb8bc, #c5cdd0 52%, #a9b4b8) !important;
}

body[data-view="board"] .linux-board-scene .board-game-bar,
body[data-view="board"] .linux-board-scene .board-system-hud.board-control-deck {
  border-color: color-mix(in srgb, var(--level-accent, #cb217f) 38%, var(--line));
  box-shadow: inset 4px 0 var(--level-accent, #cb217f), 0 18px 38px rgba(0, 0, 0, 0.2) !important;
}

body[data-view="board"] .linux-board-scene .level-pass {
  background:
    linear-gradient(105deg, color-mix(in srgb, var(--level-accent, #cb217f) 24%, transparent), transparent 48%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, rgba(0, 0, 0, 0.02) 1px 3px) !important;
}

body[data-view="board"] .linux-board-scene .position-card.legend.legend-unqualified {
  border-color: rgba(232, 48, 149, 0.72) !important;
  background: linear-gradient(135deg, rgba(218, 35, 135, 0.34), rgba(95, 22, 67, 0.24) 54%, rgba(20, 25, 29, 0.7)) !important;
  box-shadow: 0 18px 42px rgba(205, 28, 124, 0.22), inset 0 1px rgba(255, 215, 237, 0.14) !important;
}

body[data-view="board"] .linux-board-scene .position-card.legend.legend-unqualified::before {
  background: #e83095;
  box-shadow: 0 0 0 1px rgba(232, 48, 149, 0.62), 0 0 18px rgba(232, 48, 149, 0.58);
}

body[data-view="board"] .linux-board-scene .position-card.legend.legend-unqualified .slot-label {
  color: #ff73bd;
}

/* Safari can flash the whole board while recompositing nested backdrop filters on click. */
body[data-view="board"] {
  -webkit-tap-highlight-color: transparent;
}

body[data-view="board"] .board-game-bar,
body[data-view="board"] .board-system-hud.board-control-deck,
body[data-view="board"] .linux-board-scene .position-card,
body[data-view="board"] .linux-board-scene .position-user,
body[data-view="board"] .linux-board-scene .position-user-button {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Unified board cards: one surface, one size, no nested card treatment. */
body[data-view="board"] .unity-tree {
  margin-top: 18px;
  padding-top: 14px;
  grid-template-rows: repeat(3, 118px);
  gap: 18px 24px;
}

.gift-details-dialog {
  width: min(520px, calc(100vw - 28px));
  padding: 22px;
  border: 1px solid rgba(131, 150, 145, 0.24);
  border-radius: 18px;
  color: #eef4f1;
  background: rgba(16, 22, 26, 0.98);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

.gift-details-dialog::backdrop {
  background: rgba(5, 9, 12, 0.72);
  backdrop-filter: blur(5px);
}

.gift-details-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 14px;
}

.gift-details-head small,
.gift-details-id span {
  display: block;
  color: #84918d;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.gift-details-head h3 {
  margin: 2px 0 7px;
  color: #fff;
  font-size: 24px;
}

.gift-details-symbol {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 15px;
  color: #315fbd;
  background: #e9efff;
  box-shadow: 0 10px 24px rgba(49, 95, 189, 0.2);
  font-size: 20px;
  font-weight: 900;
}

.gift-details-symbol.confirmed { color: #16743b; background: #dcf7e7; }
.gift-details-symbol.disputed { color: #a72828; background: #ffe4e4; }

.gift-details-dialog .icon-action {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #a8b2af;
}

.gift-details-grid {
  margin: 20px 0 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gift-details-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.gift-details-grid dt {
  margin-bottom: 5px;
  color: #7f8c88;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.gift-details-grid dd {
  margin: 0;
  overflow: hidden;
  color: #eef4f1;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gift-details-id {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gift-details-id code { color: #b9c4c0; }

.gift-details-dialog .profile-dialog-actions {
  gap: 8px;
  margin-top: 16px;
}

html[data-resolved-theme="light"] .gift-details-dialog {
  color: #17201e;
  background: rgba(225, 231, 232, 0.98);
}

html[data-resolved-theme="light"] .gift-details-head h3,
html[data-resolved-theme="light"] .gift-details-grid dd { color: #17201e; }
html[data-resolved-theme="light"] .gift-details-grid > div { border-color: rgba(26, 42, 38, 0.1); background: rgba(255, 255, 255, 0.42); }
html[data-resolved-theme="light"] .gift-details-id { border-color: rgba(26, 42, 38, 0.12); }
html[data-resolved-theme="light"] .gift-details-id code { color: #46534f; }

@media (max-width: 560px) {
  .gift-details-grid { grid-template-columns: 1fr; }
  .gift-details-dialog { padding: 16px; }
}

body[data-view="board"] .unity-tree .position-card,
body[data-view="board"] .unity-tree > .position-card.legend,
body[data-view="board"] .team-branch > .position-card.left_builder,
body[data-view="board"] .team-branch > .position-card.right_builder,
body[data-view="board"] .branch-donors > .position-card,
body[data-view="board"] .branch-donors > .position-card.empty {
  width: min(288px, 100%);
  height: 118px;
  min-height: 118px;
  margin-inline: auto;
  padding: 12px 14px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

body[data-view="board"] .unity-tree .position-card.has-actions {
  padding-bottom: 12px;
}

body[data-view="board"] .unity-tree .position-head {
  min-width: 0;
  gap: 8px;
}

body[data-view="board"] .unity-tree .slot-label {
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view="board"] .unity-tree .position-badges {
  flex: 0 0 auto;
  gap: 5px;
}

body[data-view="board"] .unity-tree .position-user,
body[data-view="board"] .unity-tree .position-user-button,
html[data-resolved-theme="dark"] body[data-view="board"] .linux-board-scene .board-tree .position-user,
html[data-resolved-theme="dark"] body[data-view="board"] .linux-board-scene .board-tree .position-user-button,
html[data-resolved-theme="light"] body[data-view="board"] .linux-board-scene .board-tree .position-user,
html[data-resolved-theme="light"] body[data-view="board"] .linux-board-scene .board-tree .position-user-button {
  width: 100%;
  min-height: 0;
  height: 100%;
  display: grid !important;
  grid-template-columns: 26px 46px minmax(0, 1fr) 30px !important;
  align-items: center;
  padding: 0;
  gap: 10px;
  border: 0 !important;
  border-radius: 0;
  color: inherit;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-view="board"] .unity-tree .position-user-button:hover {
  background: transparent !important;
  transform: none;
}

body[data-view="board"] .unity-tree .avatar-mini,
body[data-view="board"] .unity-tree > .position-card.legend .avatar-mini,
body[data-view="board"] .unity-tree .position-card.left_builder .avatar-mini,
body[data-view="board"] .unity-tree .position-card.right_builder .avatar-mini {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 12px;
  font-size: 18px;
}

body[data-view="board"] .unity-tree .position-user-copy {
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

body[data-view="board"] .unity-tree .position-user-copy strong {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: inherit;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view="board"] .position-telegram {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  margin-left: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #2aabee;
  box-shadow: 0 6px 16px rgba(42, 171, 238, 0.22);
}

body[data-view="board"] .position-telegram i {
  width: 100%;
  height: 100%;
  background: url("/assets/telegram-messenger.png") center / cover no-repeat;
}

body[data-view="board"] .position-telegram:not(.has-telegram) {
  opacity: 0.32;
  filter: grayscale(1);
}

body[data-view="board"] .unity-tree .position-state-icon {
  position: static;
  inset: auto;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  margin: 0;
  border-width: 2px;
}

body[data-view="board"] .unity-tree .position-state-placeholder {
  width: 26px;
  height: 26px;
  display: block;
}

body[data-view="board"] .unity-tree .position-telegram-placeholder {
  width: 30px;
  height: 30px;
  display: block;
}

body[data-view="board"] .unity-tree .position-actions {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 3;
}

body[data-view="board"] .unity-tree .position-card.has-actions .position-user {
  padding-right: 92px;
}

body[data-view="board"] .unity-tree .position-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 10px;
}

body[data-view="board"] .unity-tree .position-card.empty .position-user {
  justify-content: flex-start;
}

body[data-view="board"] .unity-tree .position-card {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--level-accent, #cb217f) 10%, rgba(24, 30, 34, 0.72)), rgba(17, 22, 26, 0.76)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px) !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.055) !important;
}

body[data-view="board"] .unity-tree .position-card::after {
  inset: 0;
  border-color: color-mix(in srgb, var(--level-accent, #cb217f) 13%, transparent);
  border-radius: inherit;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.035), transparent 32%);
  pointer-events: none;
}

@media (max-width: 760px) {
  body[data-view="board"] .unity-tree {
    grid-template-rows: none;
  }

  body[data-view="board"] .unity-tree .position-card,
  body[data-view="board"] .unity-tree > .position-card.legend,
  body[data-view="board"] .team-branch > .position-card.left_builder,
  body[data-view="board"] .team-branch > .position-card.right_builder,
  body[data-view="board"] .branch-donors > .position-card,
  body[data-view="board"] .branch-donors > .position-card.empty {
    width: 100%;
    height: 112px;
    min-height: 112px;
  }
}

/* Compact board navigation: stable dimensions prevent layout shifts on switch. */
body[data-view="board"] .board-game-bar .board-switcher {
  width: auto;
  max-width: min(52vw, 620px);
  min-width: 0;
}

body[data-view="board"] .board-game-bar .board-switcher-tabs {
  min-height: 40px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

body[data-view="board"] .board-game-bar .board-switcher-tab {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 10px;
  color: #fff;
  background: var(--board-level-color, #69757f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 12px rgba(0, 0, 0, 0.2);
}

body[data-view="board"] .board-game-bar .board-switcher-tab:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

body[data-view="board"] .board-game-bar .board-switcher-tab.is-active {
  color: #fff;
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(203, 33, 127, 0.48), 0 6px 16px rgba(0, 0, 0, 0.26);
}

body[data-view="board"] .board-game-bar .board-tab-level {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: inherit;
  color: inherit;
  background: transparent;
  box-shadow: none;
}

body[data-view="board"] .board-game-bar .board-tab-level small {
  display: none;
}

body[data-view="board"] .board-game-bar .board-tab-level strong {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

body[data-view="board"] .board-game-bar .board-tab-copy,
body[data-view="board"] .board-game-bar .board-tab-state {
  display: none;
}

body[data-view="board"] .unity-tree .position-card.is-current-user .avatar-mini {
  border-color: #ff4d5f !important;
  box-shadow: 0 0 0 3px rgba(255, 77, 95, 0.32), 0 0 18px rgba(255, 77, 95, 0.28) !important;
}

/* The whole user surface opens the profile; status and Telegram remain independent controls. */
body[data-view="board"] .unity-tree .position-user,
body[data-view="board"] .unity-tree .position-user-button,
html[data-resolved-theme="dark"] body[data-view="board"] .linux-board-scene .board-tree .position-user-button,
html[data-resolved-theme="light"] body[data-view="board"] .linux-board-scene .board-tree .position-user-button {
  grid-template-columns: 46px minmax(0, 1fr) auto !important;
  cursor: pointer;
}

body[data-view="board"] .unity-tree .position-card[data-user-profile] {
  cursor: pointer;
}

body[data-view="board"] .unity-tree .position-card.empty .position-user {
  grid-template-columns: 26px 46px minmax(0, 1fr) 30px !important;
  cursor: default;
}

body[data-view="board"] .unity-tree .position-card-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

body[data-view="board"] .unity-tree .position-card-tools .position-state-icon,
body[data-view="board"] .unity-tree .position-card-tools .position-telegram {
  position: static;
  inset: auto;
  margin: 0;
  transform: none;
  cursor: pointer;
}

body[data-view="board"] .unity-tree .position-card-tools .position-state-icon {
  order: 1;
  padding: 0;
  font: inherit;
}

body[data-view="board"] .unity-tree .position-card-tools .position-telegram {
  order: 2;
}

body[data-view="board"] .unity-tree .position-card-tools button:focus-visible,
body[data-view="board"] .unity-tree .position-card-tools a:focus-visible,
body[data-view="board"] .unity-tree .position-card[data-user-profile]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--level-accent, #cb217f) 75%, #fff);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  body[data-view="board"] .board-game-bar .board-switcher {
    max-width: min(58vw, 360px);
  }

  body[data-view="board"] .board-game-bar .board-switcher-tab {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
  }
}
