body.dashboard-page.is-booting > * {
  visibility: hidden;
}

body.dashboard-page.is-booting::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  color: var(--muted, #63725f);
  background-color: var(--bg, #eef7e2);
}

body.dashboard-page.is-booting::after {
  content: '';
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 3001;
  width: 36px;
  height: 36px;
  background: url('img/NetworkIcon_Elena.png') center / contain no-repeat;
  opacity: 0.8;
  pointer-events: none;
}

:root {
  --dashboard-top-control-height: 3.25rem;
  --dashboard-bar-height: 50px;
  --dashboard-bottom-control-height: 44px;
  --dashboard-rail-width: 112px;
  --fdc-bg: #eef7e2;
  --fdc-panel: rgba(255, 255, 255, 0.9);
  --fdc-text: #223321;
  --fdc-muted: #63725f;
  --fdc-border: rgba(75, 125, 67, 0.18);
  --fdc-primary: #4e9d4f;
  --fdc-primary-soft: rgba(112, 189, 91, 0.18);
  --fdc-shadow: rgba(75, 125, 67, 0.16);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f111a;
  --paper: rgba(25, 28, 41, 0.68);
  --paper-strong: rgba(25, 28, 41, 0.94);
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.08);
  --green: #6366f1;
  --green-dark: #c4b5fd;
  --red: #ef4444;
  --blue: #60a5fa;
  --gold: #f59e0b;
  --purple: #ec4899;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
  --dashboard-dark-primary: #6366f1;
  --dashboard-dark-primary-hover: #4f46e5;
  --dashboard-dark-accent: #ec4899;
  --dashboard-dark-success: #10b981;
  --dashboard-dark-panel: rgba(25, 28, 41, 0.72);
  --fdc-bg: #0b1020;
  --fdc-panel: rgba(19, 29, 52, 0.92);
  --fdc-text: #f6f8ff;
  --fdc-muted: #aeb9d1;
  --fdc-border: rgba(180, 207, 255, 0.16);
  --fdc-primary: #7aa2ff;
  --fdc-primary-soft: rgba(122, 162, 255, 0.18);
  --fdc-shadow: rgba(0, 0, 0, 0.36);
}

.dashboard-page {
  padding-top: var(--dashboard-top-control-height);
  padding-bottom: calc(var(--dashboard-bar-height) + 24px);
}

.dashboard-top-control-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1110;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  min-height: var(--dashboard-top-control-height);
  border: 0;
  border-bottom: 1px solid var(--fdc-border);
  border-radius: 0;
  padding: 0.42rem clamp(0.8rem, 3vw, 1.4rem);
  background: color-mix(in srgb, var(--fdc-bg) 86%, #000 14%);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--fdc-shadow) 72%, transparent);
  backdrop-filter: blur(12px);
}

:root[data-theme="dark"] .dashboard-top-control-bar {
  background: color-mix(in srgb, var(--fdc-bg) 86%, #000 14%);
}

.dashboard-top-status {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.dashboard-top-status strong {
  color: var(--fdc-text);
  font-size: 0.78rem;
  font-weight: 950;
}

.dashboard-top-status span {
  display: block;
  overflow: hidden;
  color: var(--fdc-muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-top-tabs,
.dashboard-top-actions {
  display: inline-flex;
  align-items: center;
}

.dashboard-top-tabs {
  justify-content: center;
  gap: 0.3rem;
}

.dashboard-top-actions {
  justify-content: flex-end;
  gap: 0.45rem;
  min-width: 0;
}

.dashboard-top-control-bar button,
.dashboard-top-control-bar a {
  min-width: 4.4rem;
  border: 1px solid var(--fdc-border);
  border-radius: 999px;
  padding: 0.48rem 0.78rem;
  color: var(--fdc-text);
  background: var(--fdc-panel);
  box-shadow: 0 8px 20px var(--fdc-shadow);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.dashboard-top-tabs button,
.dashboard-top-tabs a {
  box-shadow: none;
}

.dashboard-top-control-bar button.is-active,
.dashboard-top-control-bar a.is-active {
  border-color: color-mix(in srgb, var(--fdc-primary) 58%, var(--fdc-border));
  background: var(--fdc-primary-soft);
  color: var(--fdc-text);
}

:root[data-theme="dark"] .dashboard-top-control-bar button,
:root[data-theme="dark"] .dashboard-top-control-bar a {
  background: var(--fdc-panel);
  color: var(--fdc-text);
}

.dashboard-top-theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem !important;
  padding: 0 !important;
  color: #f39a22 !important;
  font-size: 1.45rem;
  line-height: 1;
}

:root[data-theme="dark"] .dashboard-top-theme-toggle {
  color: #f5c94e !important;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15), transparent 25%),
    var(--bg);
}

.theme-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.58);
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
}

.theme-toggle {
  cursor: pointer;
}

.theme-toggle[aria-pressed="true"] {
  color: #102017;
  border-color: rgba(110, 231, 160, 0.58);
  background: linear-gradient(135deg, #6ee7a0, #3ba66b);
}

:root[data-theme="dark"] .theme-toggle {
  color: var(--green-dark);
  background: rgba(21, 34, 52, 0.82);
}

:root[data-theme="dark"] .theme-toggle[aria-pressed="true"] {
  color: #ffffff;
  border-color: rgba(236, 72, 153, 0.55);
  background: linear-gradient(135deg, var(--dashboard-dark-primary), var(--dashboard-dark-accent));
}

.dashboard-layout {
  width: min(1440px, 100%);
  min-height: calc(100vh - var(--dashboard-top-control-height) - var(--dashboard-bar-height));
  display: grid;
  grid-template-columns: var(--dashboard-rail-width) minmax(0, 1fr);
  gap: 16px;
  margin: 0 auto;
  padding: 16px;
}

.dashboard-rail {
  position: sticky;
  top: calc(var(--dashboard-top-control-height) + 16px);
  align-self: start;
  display: grid;
  gap: 7px;
  padding: 6px 0;
}

.dashboard-rail button {
  position: relative;
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 999px 14px 14px 999px;
  padding: 4px 10px 4px 4px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.dashboard-rail-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid rgba(45, 111, 69, 0.22);
  border-radius: 50%;
  background: linear-gradient(145deg, #82c98e, #3d8c5b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.dashboard-rail-icon img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: saturate(0.92) brightness(1.08);
}

.dashboard-rail button strong {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  line-height: 1.12;
  white-space: normal;
}

.dashboard-rail-label {
  display: grid;
  gap: 1px;
}

.dashboard-rail-label small {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 900;
  line-height: 1;
}

.dashboard-rail button.is-active {
  color: var(--green-dark);
  background: linear-gradient(90deg, rgba(82, 159, 101, 0.34), rgba(82, 159, 101, 0.12));
}

:root[data-theme="dark"] .dashboard-rail button {
  color: rgba(237, 245, 255, 0.68);
}

:root[data-theme="dark"] .dashboard-rail button.is-active {
  color: var(--green-dark);
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.24), rgba(236, 72, 153, 0.1));
}

:root[data-theme="dark"] .dashboard-rail-icon {
  border-color: rgba(196, 181, 253, 0.28);
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.5), rgba(236, 72, 153, 0.24));
}

:root[data-theme="dark"] .dashboard-rail button.is-active .dashboard-rail-icon {
  border-color: rgba(196, 181, 253, 0.72);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.dashboard-rail button.is-active .dashboard-rail-icon {
  border-color: rgba(30, 99, 54, 0.54);
  box-shadow: 0 0 0 3px rgba(82, 159, 101, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.dashboard-rail .rail-equipment {
  width: calc(100% - 10px);
  margin-left: 10px;
}

.dashboard-main,
.dashboard-view {
  min-width: 0;
}

.dashboard-main {
  scroll-margin-top: calc(var(--dashboard-top-control-height) + 12px);
}

.apostle-open-settings {
  min-height: 30px;
  margin-top: 7px;
  border: 1px solid rgba(36, 83, 59, 0.18);
  border-radius: 10px;
  padding: 0 10px;
  color: var(--green-dark);
  background: rgba(62, 119, 84, 0.08);
  font-size: 0.66rem;
  font-weight: 900;
  cursor: pointer;
}

.dashboard-view {
  display: none;
  gap: 14px;
}

.dashboard-view.is-active {
  display: grid;
}

.dashboard-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .dashboard-card,
:root[data-theme="dark"] .state-card,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .control-card,
:root[data-theme="dark"] .summary-hero,
:root[data-theme="dark"] .apostle-workbench {
  background: var(--dashboard-dark-panel);
  border-color: var(--line);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .profile-meta-select,
:root[data-theme="dark"] .profile-skill-levels select,
:root[data-theme="dark"] .card-manager-search input,
:root[data-theme="dark"] .formation-save-fields input {
  color: var(--ink);
  border-color: rgba(166, 180, 197, 0.24);
  background: rgba(8, 15, 26, 0.72);
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: rgba(166, 180, 197, 0.72);
}

:root[data-theme="dark"] button:not(.theme-toggle),
:root[data-theme="dark"] .apostle-picker-button,
:root[data-theme="dark"] .back-link {
  color: var(--green-dark);
  border-color: rgba(166, 180, 197, 0.24);
  background: rgba(18, 31, 48, 0.82);
}

:root[data-theme="dark"] button:not(.theme-toggle):hover:not(:disabled),
:root[data-theme="dark"] .apostle-picker-button:hover,
:root[data-theme="dark"] .back-link:hover {
  border-color: rgba(99, 102, 241, 0.38);
  background: rgba(99, 102, 241, 0.12);
}

:root[data-theme="dark"] .board-node,
:root[data-theme="dark"] .board-shortcut {
  background-color: transparent;
  background-image: var(--tile-base);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

:root[data-theme="dark"] .board-node:hover:not(:disabled),
:root[data-theme="dark"] .board-shortcut:hover:not(:disabled) {
  background-color: transparent;
  background-image: var(--tile-base);
}

:root[data-theme="dark"] .board-node.is-empty,
:root[data-theme="dark"] .board-node.is-empty:hover:not(:disabled) {
  background: transparent;
}

:root[data-theme="dark"] .apostle-picker-dialog,
:root[data-theme="dark"] .formation-picker-dialog,
:root[data-theme="dark"] .resource-effect-popover,
:root[data-theme="dark"] .resource-effect-overlay {
  color: var(--ink);
  border-color: rgba(166, 180, 197, 0.24);
  background: rgba(14, 24, 38, 0.98);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.58);
}

:root[data-theme="dark"] .apostle-picker-dialog::backdrop,
:root[data-theme="dark"] .formation-picker-dialog::backdrop {
  background: rgba(2, 8, 15, 0.72);
}

:root[data-theme="dark"] .apostle-picker-card,
:root[data-theme="dark"] .formation-picker-option,
:root[data-theme="dark"] .formation-save-item {
  color: var(--ink);
  border-color: rgba(166, 180, 197, 0.18);
  background-color: rgba(20, 34, 52, 0.82);
}

:root[data-theme="dark"] button.apostle-picker-card {
  color: #1f2933 !important;
  border-color: rgba(226, 232, 240, 0.42) !important;
  background: rgba(255, 255, 255, 0.96) !important;
}

:root[data-theme="dark"] button.apostle-picker-card:hover:not(:disabled),
:root[data-theme="dark"] button.apostle-picker-card:focus-visible {
  color: #111827 !important;
  border-color: rgba(134, 239, 172, 0.55) !important;
  background: rgba(255, 255, 255, 0.98) !important;
}

:root[data-theme="dark"] button.apostle-picker-card .apostle-picker-art {
  background: color-mix(in srgb, var(--apostle-personality-color, #d8e4d1) 42%, white) !important;
}

:root[data-theme="dark"] button.apostle-picker-card > strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  padding: 0 4px;
  color: #1f2933 !important;
  background: transparent !important;
  text-overflow: ellipsis;
  text-shadow: none !important;
  white-space: nowrap;
}

:root[data-theme="dark"] .dashboard-rail button {
  border-color: transparent;
  background: transparent;
}

:root[data-theme="dark"] .dashboard-rail button:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.1);
}

.dashboard-card .stat-breakdown-table,
.dashboard-card .research-table-wrap,
.dashboard-card .compact-table-wrap {
  max-width: 100%;
}

.dashboard-page .stat-breakdown-table table {
  width: max-content;
  min-width: 820px;
}

.dashboard-page .research-table,
.dashboard-page .compact-table {
  width: max-content;
  min-width: min(100%, 520px);
}

.dashboard-page .research-table th,
.dashboard-page .research-table td,
.dashboard-page .compact-table th,
.dashboard-page .compact-table td {
  min-width: 72px;
}

.dashboard-page .research-table th:first-child,
.dashboard-page .research-table td:first-child,
.dashboard-page .compact-table th:first-child,
.dashboard-page .compact-table td:first-child {
  min-width: 116px;
}

:root[data-theme="dark"] .stat-breakdown-table table,
:root[data-theme="dark"] .research-table,
:root[data-theme="dark"] .compact-table,
:root[data-theme="dark"] .equipment-value-table,
:root[data-theme="dark"] .equipment-value-table table,
:root[data-theme="dark"] .board-global-stat-matrix,
:root[data-theme="dark"] .board-global-change-matrix {
  color: var(--ink);
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.34);
}

:root[data-theme="dark"] .stat-breakdown-table th,
:root[data-theme="dark"] .stat-breakdown-table td,
:root[data-theme="dark"] .research-table th,
:root[data-theme="dark"] .research-table td,
:root[data-theme="dark"] .compact-table th,
:root[data-theme="dark"] .compact-table td,
:root[data-theme="dark"] .equipment-value-table th,
:root[data-theme="dark"] .equipment-value-table td,
:root[data-theme="dark"] .board-global-stat-matrix th,
:root[data-theme="dark"] .board-global-stat-matrix td,
:root[data-theme="dark"] .board-global-change-matrix th,
:root[data-theme="dark"] .board-global-change-matrix td {
  border-color: rgba(148, 163, 184, 0.14);
}

:root[data-theme="dark"] .stat-breakdown-table tbody td,
:root[data-theme="dark"] .research-table tbody td,
:root[data-theme="dark"] .compact-table tbody td,
:root[data-theme="dark"] .equipment-value-table tbody td,
:root[data-theme="dark"] .board-global-stat-matrix tbody td,
:root[data-theme="dark"] .board-global-change-matrix tbody td {
  color: rgba(241, 245, 249, 0.92);
}

:root[data-theme="dark"] .stat-breakdown-table thead th,
:root[data-theme="dark"] .research-table th,
:root[data-theme="dark"] .compact-table thead th,
:root[data-theme="dark"] .equipment-value-table thead th,
:root[data-theme="dark"] .board-global-stat-matrix thead th,
:root[data-theme="dark"] .board-global-change-matrix thead th {
  color: rgba(226, 232, 240, 0.86);
  background: rgba(99, 102, 241, 0.12);
}

:root[data-theme="dark"] .stat-breakdown-table tbody th,
:root[data-theme="dark"] .compact-table tbody th,
:root[data-theme="dark"] .equipment-value-table tbody th,
:root[data-theme="dark"] .board-global-stat-matrix tbody th,
:root[data-theme="dark"] .board-global-change-matrix tbody th {
  color: #c4b5fd;
}

:root[data-theme="dark"] .research-table tbody th {
  color: #c4b5fd;
}

:root[data-theme="dark"] .stat-breakdown-table tbody tr.hp th {
  color: #86efac;
}

:root[data-theme="dark"] .stat-breakdown-table tbody tr.attack th {
  color: #fca5a5;
}

:root[data-theme="dark"] .stat-breakdown-table tbody tr.defense th {
  color: #93c5fd;
}

:root[data-theme="dark"] .stat-breakdown-table tbody tr.crit th {
  color: #fbbf24;
}

:root[data-theme="dark"] .stat-breakdown-table tbody tr.crit-res th {
  color: #d8b4fe;
}

:root[data-theme="dark"] .stat-breakdown-table td.total,
:root[data-theme="dark"] .compact-table .value,
:root[data-theme="dark"] .research-table .value,
:root[data-theme="dark"] .equipment-value-table .value,
:root[data-theme="dark"] .board-global-stat-matrix td strong {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
}

:root[data-theme="dark"] .rank-summary-tables,
:root[data-theme="dark"] .summary-table-grid,
:root[data-theme="dark"] .research-table-wrap,
:root[data-theme="dark"] .compact-table-wrap {
  background: transparent;
}

.apostle-info-card {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(300px, 1fr);
  gap: 22px;
  align-items: center;
}

.apostle-info-profile {
  grid-column: 1;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
  border-radius: 18px;
  cursor: default;
}

.dashboard-portrait {
  position: relative;
  width: 112px;
  height: 112px;
  margin-bottom: 27px;
  border-radius: 28px;
  overflow: visible;
}

.dashboard-portrait > #apostle-image {
  border-radius: 28px;
  overflow: hidden;
  cursor: pointer;
}
.dashboard-portrait > #apostle-image:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--profile-personality-color, var(--green)) 58%, transparent);
  outline-offset: 3px;
}
#board-special-list .board-shortcut,
#board-special-list .board-shortcut * {
  cursor: pointer !important;
}

.portrait-frame .profile-aside-icon {
  position: absolute;
  z-index: 3;
  right: -23px;
  top: -23px;
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: transparent;
  image-rendering: auto;
  filter: none;
  cursor: pointer;
}

.portrait-frame .profile-aside-icon:not(.is-loaded) {
  opacity: 0;
  pointer-events: none;
}

.portrait-frame .profile-aside-icon.is-inactive {
  filter: grayscale(1) brightness(0.82);
  opacity: 0.58;
}

.portrait-frame .profile-aside-icon:focus-visible {
  outline: 3px solid rgba(221, 171, 71, 0.48);
  outline-offset: 2px;
  border-radius: 50%;
}

.profile-identity {
  flex: 1 1 auto;
  min-width: 0;
}

.profile-name-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.profile-name-row > h2 {
  flex: 0 1 auto;
  min-width: 0;
  max-width: calc(100% - 42px);
}

.profile-favorite-button {
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-top: 3px;
  overflow: hidden;
  border: 2px solid rgba(245, 183, 45, 0.9);
  border-radius: 12px;
  padding: 3px;
  background: linear-gradient(145deg, #fff8d7, #ead18a);
  box-shadow: 0 4px 12px rgba(97, 57, 9, 0.25);
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.profile-favorite-button[hidden] {
  display: none;
}

.profile-favorite-button:hover,
.profile-favorite-button:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 7px 16px rgba(97, 57, 9, 0.3);
}

.profile-favorite-button:focus-visible {
  outline: 3px solid rgba(245, 183, 45, 0.38);
  outline-offset: 2px;
}

.profile-favorite-button img {
  width: 112%;
  height: 112%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.profile-favorite-button.is-spell {
  padding: 0;
}

.profile-favorite-button.is-spell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-favorite-button.is-unowned img {
  filter: grayscale(0.7) brightness(0.82);
  opacity: 0.78;
}

:root[data-theme="dark"] button.profile-favorite-button {
  border-color: rgba(250, 204, 21, 0.78);
  background: linear-gradient(145deg, rgba(112, 77, 15, 0.94), rgba(41, 31, 17, 0.98));
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.4);
}

.apostle-info-profile h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 4px 0 5px;
  font-size: 1.65rem;
}

.profile-name-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.profile-combat-power {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  margin-top: -1px;
  padding: 1px 7px 1px 3px;
  border-radius: 999px;
  color: #8a4b0e;
  background: rgba(255, 239, 184, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
  font-size: 0.78rem;
  font-weight: 1000;
  line-height: 1;
}

.dashboard-portrait .profile-combat-power {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  justify-content: center;
  max-width: 118px;
  margin-top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}
.profile-combat-power img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.profile-combat-power strong {
  transform: translateY(1px);
}

.apostle-name-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 3px 8px;
  color: #fff;
  background: linear-gradient(135deg, rgba(58, 77, 66, 0.92), rgba(87, 118, 91, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0.03em;
}

.profile-meta-main,
.profile-meta-bottomline {
  display: flex;
  min-width: 0;
}

.profile-meta-main {
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-top: 3px;
}

.profile-meta-bottomline {
  width: 100%;
}

.profile-chip-row {
  grid-column: 1;
  width: 100%;
  margin-top: 9px;
  container-type: inline-size;
}

.profile-equipment-chips {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
}

.profile-meta-chip-equipment {
  align-items: center;
  max-width: 100%;
  white-space: normal;
  background: rgba(77, 137, 184, 0.12);
}

.profile-equipment-chip {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 0;
  border-radius: 999px;
  padding: 2px 5px;
  color: #314c63;
  background: rgba(74, 112, 126, 0.1);
  white-space: nowrap;
}

.profile-equipment-chip small {
  width: 20px;
  flex: 0 0 20px;
  color: rgba(58, 76, 92, 0.68);
  font-size: 0.59rem;
  font-weight: 900;
  text-align: center;
}

.profile-equipment-chip select {
  width: 44px;
  min-height: 18px;
  border: 0;
  border-radius: 999px;
  padding: 1px 11px 1px 3px;
  color: #314c63;
  background: rgba(65, 103, 119, 0.13);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 1000;
  line-height: 1;
  cursor: pointer;
}

.profile-equipment-chip select:focus {
  outline: 2px solid rgba(75, 131, 178, 0.3);
  outline-offset: 1px;
}

.profile-equipment-chip.is-empty {
  filter: grayscale(0.28);
  opacity: 0.62;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-equipment-chip {
  color: rgba(239, 247, 255, 0.96);
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-equipment-chip small {
  color: rgba(205, 223, 238, 0.72);
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-equipment-chip select {
  color-scheme: dark;
  color: rgba(239, 247, 255, 0.96);
  background: rgba(10, 24, 34, 0.55);
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-chip-equipment {
  border-color: rgba(147, 197, 253, 0.28) !important;
  background: linear-gradient(135deg, rgba(31, 78, 112, 0.9), rgba(28, 45, 62, 0.9)) !important;
}

@container (max-width: 520px) {
  .profile-equipment-chips {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    grid-auto-rows: minmax(20px, auto);
  }
}

.dashboard-page .profile-meta-icons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.profile-star-follow-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.profile-follow-button {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  border: 1px solid rgba(246, 132, 61, 0.34);
  border-radius: 999px;
  padding: 2px 8px 2px 4px;
  color: #9a6040;
  background: rgba(255, 244, 229, 0.74);
  font: inherit;
  font-size: 0.66rem;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
}

.profile-follow-button img {
  width: 19px;
  height: 19px;
  object-fit: contain;
  filter: grayscale(1) opacity(0.55);
}

.profile-follow-button.is-active {
  color: #8a4d24;
  background: rgba(255, 179, 95, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.profile-follow-button.is-active img {
  filter: drop-shadow(0 2px 4px rgba(143, 84, 39, 0.22));
}

.profile-follow-button:focus-visible {
  outline: 2px solid rgba(246, 132, 61, 0.38);
  outline-offset: 2px;
}

.profile-meta-values {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 0;
  max-width: 100%;
  line-height: 1;
}

.profile-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  border: 1px solid rgba(87, 117, 86, 0.16);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 253, 247, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  color: inherit;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.profile-meta-chip:focus-visible {
  outline: 2px solid rgba(62, 119, 84, 0.36);
  outline-offset: 2px;
}

.profile-meta-chip small {
  color: rgba(66, 86, 66, 0.64);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.profile-meta-chip strong {
  color: #254f32;
  font-size: 0.78rem;
  font-weight: 1000;
}

.profile-meta-chip.is-disabled {
  cursor: not-allowed;
  filter: grayscale(0.55);
  opacity: 0.62;
}

.profile-meta-chip.is-disabled select {
  cursor: not-allowed;
}

.profile-meta-select,
.profile-skill-levels select {
  min-height: 18px;
  border: 0;
  border-radius: 999px;
  padding: 1px 16px 1px 5px;
  color: #254f32;
  background: rgba(255, 255, 255, 0.56);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 1000;
  line-height: 1;
  cursor: pointer;
}

.profile-meta-select:focus,
.profile-skill-levels select:focus {
  outline: 2px solid rgba(62, 119, 84, 0.28);
  outline-offset: 1px;
}

.profile-meta-chip-level {
  background: rgba(105, 180, 103, 0.16);
}

.profile-meta-chip-rank {
  background: rgba(98, 144, 202, 0.15);
}

.profile-meta-chip-bond {
  border-color: rgba(221, 112, 151, 0.18);
  background: rgba(255, 182, 205, 0.2);
}

.profile-meta-chip-aside,
.profile-meta-chip-aside-level {
  background: rgba(221, 171, 71, 0.16);
}

.profile-meta-chip-skill {
  background: rgba(127, 95, 177, 0.12);
}

.profile-meta-chip-equipment {
  border-color: rgba(70, 111, 127, 0.22);
  background: linear-gradient(135deg, rgba(207, 224, 225, 0.86), rgba(220, 229, 222, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.profile-meta-chip-follow {
  background: rgba(255, 147, 69, 0.16);
}

.grade-icon-set {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

/* 6年生は面で光らせず、輪郭から淡く発光させる。 */
.grade-icon-set.is-grade-max {
  filter:
    drop-shadow(0 0 2px rgba(255, 220, 252, 0.72))
    drop-shadow(0 0 5px rgba(190, 138, 255, 0.3))
    drop-shadow(0 2px 4px rgba(118, 78, 170, 0.32));
}

.grade-icon-set.is-grade-max img {
  filter: brightness(1.08) saturate(1.12);
}
.profile-skill-levels {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.profile-skill-levels label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  justify-content: center;
  min-width: 28px;
  border-radius: 999px;
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.58);
  color: #3d345d;
  font-size: 0.7rem;
  line-height: 1;
}

.profile-skill-levels label > span {
  font-size: 0.68rem;
  font-weight: 1000;
}

.profile-skill-levels select {
  width: 38px;
  padding-right: 10px;
  background: transparent;
  color: #3d345d;
  font-size: 0.7rem;
}

:root[data-theme="dark"] .profile-meta-chip,
:root[data-theme="dark"] .profile-skill-levels label {
  color-scheme: light;
  border-color: rgba(87, 117, 86, 0.16);
  color: inherit;
  background: rgba(255, 253, 247, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

:root[data-theme="dark"] .profile-meta-chip small {
  color: rgba(66, 86, 66, 0.64);
}

:root[data-theme="dark"] .profile-meta-chip strong {
  color: #254f32;
}

:root[data-theme="dark"] .profile-combat-power {
  color: #fde68a;
  background: rgba(120, 72, 20, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 12px rgba(251, 191, 36, 0.08);
}

:root[data-theme="dark"] .profile-combat-power img {
  filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.22));
}

:root[data-theme="dark"] .profile-meta-chip.is-disabled {
  opacity: 0.58;
}

:root[data-theme="dark"] .profile-meta-select,
:root[data-theme="dark"] .profile-skill-levels select {
  color-scheme: light;
  border: 0;
  color: #254f32;
  background: rgba(255, 255, 255, 0.56);
}

:root[data-theme="dark"] .profile-meta-chip-level {
  background: rgba(105, 180, 103, 0.16);
}

:root[data-theme="dark"] .profile-meta-chip-rank {
  background: rgba(98, 144, 202, 0.15);
}

:root[data-theme="dark"] .profile-meta-chip-bond {
  border-color: rgba(221, 112, 151, 0.18);
  background: rgba(255, 182, 205, 0.2);
}

:root[data-theme="dark"] .profile-meta-chip-aside,
:root[data-theme="dark"] .profile-meta-chip-aside-level {
  background: rgba(221, 171, 71, 0.16);
}

:root[data-theme="dark"] .profile-meta-chip-skill {
  background: rgba(127, 95, 177, 0.12);
}

:root[data-theme="dark"] .profile-meta-chip-follow {
  background: rgba(255, 147, 69, 0.16);
}

:root[data-theme="dark"] .profile-skill-levels label {
  color: #3d345d;
  background: rgba(255, 255, 255, 0.58);
}

:root[data-theme="dark"] .profile-skill-levels select {
  color: #3d345d;
  background: transparent;
}

.dashboard-page .apostle-info-badge.attack-type {
  background: transparent;
}

.dashboard-stat-list {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.dashboard-stat-list .stat-inline {
  width: 100%;
  min-width: 0;
  grid-template-columns: 28px 1fr auto;
  grid-template-areas: "icon label value";
  border-bottom: 1px solid rgba(68, 82, 65, 0.09);
  padding: 5px 3px;
}

.dashboard-stat-list .stat-inline:last-child {
  border-bottom: 0;
}

.dashboard-stat-list .stat-inline img {
  width: 24px;
  height: 24px;
}

.dashboard-stat-list .stat-inline .label {
  font-size: 0.72rem;
}

.dashboard-stat-list .stat-inline .value {
  font-size: 1.02rem;
  text-align: right;
}

.dashboard-stat-list .stat-inline.combat-power {
  color: #b45309;
  border-bottom-color: rgba(217, 119, 6, 0.22);
}

.combat-power-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #fff7ed;
  background: linear-gradient(135deg, #f59e0b, #dc2626 58%, #7c2d12);
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.28);
  font-size: 0.58rem;
  font-weight: 1000;
  letter-spacing: -0.04em;
  line-height: 1;
}

.dashboard-stat-list .stat-inline.crit {
  color: #d97706;
}

.dashboard-stat-list .stat-inline.crit-res {
  color: #8b5cf6;
}

.info-subcard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}

.info-subcard .effect-details,
.info-subcard .active-effect-list {
  min-width: 0;
  max-width: 100%;
}

.apostle-favorite-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
  border: 1px solid rgba(180, 125, 24, 0.2);
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255, 250, 225, 0.74), rgba(255, 255, 255, 0.5));
}

.apostle-favorite-card.is-empty {
  display: block;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.38);
}

.apostle-favorite-card.is-empty p {
  margin: 0;
}

.profile-favorite-dialog {
  width: min(760px, calc(100vw - 24px));
  max-width: 760px;
  max-height: min(86vh, 760px);
  overflow: auto;
  border: 1px solid rgba(180, 125, 24, 0.28);
  border-radius: 22px;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 26px 70px rgba(42, 27, 7, 0.32);
}

.profile-favorite-dialog::backdrop {
  background: rgba(19, 14, 7, 0.62);
  backdrop-filter: blur(2px);
}

.profile-favorite-dialog-head {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(180, 125, 24, 0.18);
  padding: 13px 16px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(10px);
}

.profile-favorite-dialog-head > div {
  display: grid;
  gap: 1px;
}

.profile-favorite-dialog-head span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
}

.profile-favorite-dialog-head h2 {
  margin: 0;
  color: var(--green-dark);
  font-size: 1.08rem;
}

.profile-favorite-detail {
  margin: 14px;
}

:root[data-theme="dark"] .profile-favorite-dialog {
  border-color: rgba(250, 204, 21, 0.2);
  background: var(--dashboard-dark-panel);
  box-shadow: 0 28px 74px rgba(0, 0, 0, 0.66);
}

:root[data-theme="dark"] .profile-favorite-dialog::backdrop {
  background: rgba(2, 8, 15, 0.76);
}

:root[data-theme="dark"] .profile-favorite-dialog-head {
  border-bottom-color: rgba(250, 204, 21, 0.14);
  background: rgba(14, 24, 38, 0.94);
}

:root[data-theme="dark"] .profile-favorite-dialog-head h2 {
  color: #fde68a;
}

.apostle-favorite-media {
  width: 96px;
  min-width: 0;
}

.apostle-favorite-image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  padding: 0;
  border: 3px solid rgba(251, 191, 36, 0.88);
  border-radius: 11px;
  background: rgba(98, 63, 20, 0.12);
  box-shadow: 0 7px 18px rgba(180, 83, 9, 0.14);
}

.apostle-favorite-frame {
  position: absolute;
  z-index: 1;
  inset: -7px;
  width: calc(100% + 14px);
  height: calc(100% + 14px);
  object-fit: cover;
  pointer-events: none;
}

.apostle-favorite-image {
  position: relative;
  z-index: 2;
  width: 72%;
  height: auto;
  max-height: 72%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.apostle-favorite-media.is-spell .apostle-favorite-image {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

.apostle-favorite-image-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #6b4d0c;
  font-size: 1.6rem;
  font-weight: 950;
}

.apostle-favorite-media.is-unowned .apostle-favorite-frame,
.apostle-favorite-media.is-unowned .apostle-favorite-image {
  filter: grayscale(0.72) brightness(0.82);
  opacity: 0.78;
}

.apostle-favorite-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.apostle-favorite-title {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.apostle-favorite-title > div:first-child {
  display: grid;
  min-width: 0;
}

.apostle-favorite-title strong {
  color: var(--green-dark);
  font-size: 1rem;
  line-height: 1.35;
}

.apostle-favorite-title > div:first-child span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}

.apostle-favorite-state {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.apostle-favorite-state > span {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border: 1px solid rgba(180, 125, 24, 0.2);
  border-radius: 999px;
  padding: 3px 8px;
  color: #725213;
  background: rgba(254, 243, 199, 0.74);
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.apostle-favorite-state > span.is-owned {
  color: #166534;
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(220, 252, 231, 0.74);
}

.apostle-favorite-state > span.is-unowned {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.12);
}

.apostle-favorite-cost img {
  width: 19px;
  height: 19px;
  margin-right: 2px;
  object-fit: contain;
}

.apostle-favorite-levels {
  display: grid;
  gap: 6px;
}

.apostle-favorite-level {
  min-width: 0;
  border: 1px solid rgba(180, 125, 24, 0.14);
  border-radius: 10px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.64);
}

.apostle-favorite-level.is-locked {
  opacity: 0.68;
  filter: saturate(0.68);
}

.apostle-favorite-level-head {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  align-items: center;
}

.apostle-favorite-level-head strong {
  color: #6b4d0c;
  font-size: 0.82rem;
}

.apostle-favorite-level-head > span {
  border-radius: 999px;
  padding: 2px 7px;
  color: #6b4d0c;
  background: rgba(250, 204, 21, 0.2);
  font-size: 0.64rem;
  font-weight: 950;
}

.apostle-favorite-level-head em {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 850;
}

.apostle-favorite-description {
  margin: 6px 0 0;
  color: #425349;
  font-size: 0.73rem;
  line-height: 1.5;
  white-space: pre-line;
}

.apostle-favorite-manage {
  justify-self: end;
  min-height: 32px;
  border: 1px solid rgba(180, 125, 24, 0.28);
  border-radius: 999px;
  padding: 5px 12px;
  color: #6b4d0c;
  background: rgba(254, 243, 199, 0.7);
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
}

:root[data-theme="dark"] .apostle-favorite-card {
  border-color: rgba(250, 204, 21, 0.2);
  background: linear-gradient(135deg, rgba(66, 48, 18, 0.58), rgba(15, 23, 42, 0.72));
}

:root[data-theme="dark"] .apostle-favorite-card.is-empty {
  background: rgba(15, 23, 42, 0.54);
}

:root[data-theme="dark"] .apostle-favorite-title strong {
  color: #fde68a;
}

:root[data-theme="dark"] .apostle-favorite-state > span {
  color: #fde68a;
  border-color: rgba(250, 204, 21, 0.24);
  background: rgba(161, 98, 7, 0.18);
}

:root[data-theme="dark"] .apostle-favorite-state > span.is-owned {
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.24);
  background: rgba(22, 101, 52, 0.28);
}

:root[data-theme="dark"] .apostle-favorite-state > span.is-unowned {
  color: rgba(226, 232, 240, 0.72);
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(71, 85, 105, 0.24);
}

:root[data-theme="dark"] .apostle-favorite-level {
  border-color: rgba(250, 204, 21, 0.12);
  background: rgba(15, 23, 42, 0.58);
}

:root[data-theme="dark"] .apostle-favorite-level-head strong,
:root[data-theme="dark"] .apostle-favorite-level-head > span {
  color: #fde68a;
}

:root[data-theme="dark"] .apostle-favorite-level-head > span {
  background: rgba(202, 138, 4, 0.2);
}

:root[data-theme="dark"] .apostle-favorite-description {
  color: rgba(226, 232, 240, 0.84);
}

:root[data-theme="dark"] .apostle-favorite-manage {
  color: #fde68a;
  border-color: rgba(250, 204, 21, 0.26);
  background: rgba(161, 98, 7, 0.18);
}

@media (max-width: 520px) {
  .profile-favorite-button {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .profile-name-row > h2 {
    max-width: calc(100% - 38px);
  }

  .apostle-favorite-card {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .apostle-favorite-media {
    width: 68px;
  }

  .apostle-favorite-image-wrap {
    border-width: 2px;
    border-radius: 9px;
  }

  .apostle-favorite-title {
    display: grid;
  }

  .apostle-favorite-state {
    justify-content: flex-start;
  }

  .apostle-favorite-state > span {
    min-height: 23px;
    padding: 2px 6px;
    font-size: 0.62rem;
  }

  .apostle-favorite-level {
    padding: 6px;
  }

  .apostle-favorite-level-head em {
    width: 100%;
    margin-left: 0;
  }

  .apostle-favorite-description {
    font-size: 0.68rem;
  }

  .profile-favorite-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 20px);
    border-radius: 17px;
  }

  .profile-favorite-dialog-head {
    padding: 10px 12px;
  }

  .profile-favorite-detail {
    margin: 7px;
  }
}

.dashboard-apostle-selector {
  display: none;
  margin-bottom: 14px;
}

.dashboard-apostle-selector .apostle-field {
  max-width: 520px;
}

.apostle-setting-sections {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
  gap: 12px;
}

.apostle-setting-block {
  min-width: 0;
  border: 1px solid rgba(36, 83, 59, 0.12);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 253, 247, 0.56);
}

.growth-settings {
  grid-column: 1 / -1;
}

.setting-block-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.setting-block-head h3,
.setting-block-head p {
  margin: 0;
}

.setting-block-head h3 {
  color: var(--green-dark);
  font-size: 0.92rem;
}

.setting-block-head p {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
}

.setting-block-icon {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--green-dark);
  background: rgba(62, 119, 84, 0.11);
  font-size: 0.76rem;
  font-weight: 950;
}

.aside-settings .setting-block-icon {
  color: #76513a;
  background: rgba(213, 164, 60, 0.15);
}

.aside-setting-icon-wrap {
  width: 38px;
  height: 38px;
  overflow: hidden;
  padding: 0;
}

.aside-setting-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aside-settings.is-unavailable {
  border-color: rgba(68, 82, 65, 0.09);
  background: rgba(219, 219, 211, 0.34);
  filter: grayscale(1);
  opacity: 0.58;
}

.aside-settings.is-unavailable .aside-setting-icon-wrap {
  background: rgba(95, 101, 96, 0.14);
}

.aside-settings.is-unavailable .aside-setting-icon {
  display: none;
}

.aside-settings.is-unavailable select {
  cursor: default;
}

.skill-settings .setting-block-icon {
  color: #654588;
  background: rgba(128, 89, 168, 0.12);
}

.setting-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 10px;
}

.growth-settings .setting-field-grid {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
}

.setting-field-grid.compact {
  grid-template-columns: 1fr 1fr;
}

.refined-follow-toggle {
  min-height: 48px;
  align-self: auto;
  justify-content: flex-start;
  gap: 9px;
  border: 1px solid rgba(36, 83, 59, 0.12);
  border-radius: 13px;
  padding: 7px 10px;
  background: rgba(62, 119, 84, 0.05);
  cursor: pointer;
}

.refined-follow-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.refined-follow-toggle img {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: grayscale(1) brightness(0.92);
  opacity: 0.42;
  transition: filter 140ms ease, opacity 140ms ease, transform 140ms ease;
}

.refined-follow-toggle:has(input:checked) {
  border-color: rgba(213, 164, 60, 0.38);
  background: rgba(213, 164, 60, 0.1);
}

.refined-follow-toggle:has(input:checked) img {
  filter: none;
  opacity: 1;
  transform: scale(1.04);
}

.refined-follow-toggle:focus-within {
  outline: 2px solid rgba(62, 119, 84, 0.25);
  outline-offset: 2px;
}

.refined-follow-toggle > span {
  display: grid;
  gap: 1px;
}

.refined-follow-toggle strong {
  color: var(--green-dark);
  font-size: 0.76rem;
}

.refined-follow-toggle small {
  color: var(--muted);
  font-size: 0.62rem;
}

.skill-field-grid {
  gap: 7px;
}

.skill-level-field {
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon select";
  align-items: center;
  column-gap: 7px;
}

.skill-level-field .skill-setting-icon {
  grid-area: icon;
}

.skill-level-field > span {
  grid-area: label;
}

.skill-level-field > select {
  grid-area: select;
  min-height: 34px;
  border-radius: 10px;
  padding: 0 8px;
}

.skill-setting-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(128, 89, 168, 0.08);
}

.skill-setting-icon.is-missing {
  visibility: hidden;
}

.skill-cap-note {
  min-height: 1em;
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
}

.equipment-dashboard-head {
  align-items: end;
}

.equipment-head-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.rank-inline-control {
  width: min(180px, 100%);
}

.rank-overview-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.rank-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.rank-overview-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-areas:
    "icon name"
    "icon value";
  gap: 3px 7px;
  align-items: center;
  padding: 7px;
  border: 1px solid rgba(44, 88, 59, 0.12);
  border-radius: 14px;
  color: #294a33;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 16px rgba(44, 75, 50, 0.08);
}

.rank-overview-icon {
  grid-area: icon;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: inset 0 0 0 1px rgba(45, 111, 69, 0.1);
}

.aside-overview-card .rank-overview-icon {
  position: relative;
  z-index: 1;
  transform: scale(1.16);
}

.rank-overview-name {
  grid-area: name;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 950;
}

.rank-overview-value {
  grid-area: value;
  color: rgba(37, 72, 47, 0.84);
  font-size: 0.68rem;
  font-weight: 950;
}

.rank-overview-card select {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.rank-overview-card select:focus-visible {
  outline: 3px solid rgba(74, 163, 98, 0.34);
  outline-offset: -3px;
}

.rank-overview-card.rank-gold,
.rank-overview-card.aside-a3 {
  background: linear-gradient(135deg, rgba(255, 239, 166, 0.64), rgba(255, 255, 255, 0.74));
}

.rank-overview-card.rank-purple,
.rank-overview-card.aside-a2 {
  background: linear-gradient(135deg, rgba(216, 190, 255, 0.5), rgba(255, 255, 255, 0.74));
}

.rank-overview-card.rank-blue,
.rank-overview-card.aside-a1 {
  background: linear-gradient(135deg, rgba(186, 221, 255, 0.5), rgba(255, 255, 255, 0.74));
}

.rank-overview-card.rank-green {
  background: linear-gradient(135deg, rgba(193, 236, 192, 0.48), rgba(255, 255, 255, 0.74));
}

.rank-overview-card.personality-純粋 { --overview-personality-color: var(--personality-pure); }
.rank-overview-card.personality-冷静 { --overview-personality-color: var(--personality-calm); }
.rank-overview-card.personality-狂気 { --overview-personality-color: var(--personality-madness); }
.rank-overview-card.personality-活発 { --overview-personality-color: var(--personality-active); }
.rank-overview-card.personality-憂鬱 { --overview-personality-color: var(--personality-gloomy); }

.rank-overview-card[class*="personality-"] {
  border-color: color-mix(in srgb, var(--overview-personality-color) 44%, rgba(255, 255, 255, 0.48));
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--overview-personality-color) 28%, white),
      rgba(255, 255, 255, 0.76));
}

.rank-overview-card[class*="personality-"].rank-gold,
.rank-overview-card[class*="personality-"].aside-a3 {
  background:
    linear-gradient(135deg, rgba(255, 225, 112, 0.34), transparent 58%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--overview-personality-color) 28%, white),
      rgba(255, 255, 255, 0.76));
}

.rank-overview-card[class*="personality-"].rank-purple,
.rank-overview-card[class*="personality-"].aside-a2 {
  background:
    linear-gradient(135deg, rgba(168, 85, 247, 0.2), transparent 58%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--overview-personality-color) 28%, white),
      rgba(255, 255, 255, 0.76));
}

.rank-overview-card[class*="personality-"].rank-blue,
.rank-overview-card[class*="personality-"].aside-a1 {
  background:
    linear-gradient(135deg, rgba(96, 165, 250, 0.2), transparent 58%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--overview-personality-color) 28%, white),
      rgba(255, 255, 255, 0.76));
}

.rank-overview-card[class*="personality-"].rank-green {
  background:
    linear-gradient(135deg, rgba(74, 222, 128, 0.18), transparent 58%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--overview-personality-color) 28%, white),
      rgba(255, 255, 255, 0.76));
}

.bond-overview-card {
  grid-template-areas:
    "icon name"
    "icon value";
  cursor: pointer;
  overflow: hidden;
}

.bond-overview-card select {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.bond-overview-card select:focus-visible {
  outline: 3px solid rgba(236, 95, 157, 0.35);
  outline-offset: -3px;
}

.bond-overview-value span {
  color: #ec5f9d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.bond-overview-card.bond-max {
  border-color: rgba(220, 38, 38, 0.26);
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.58), rgba(255, 255, 255, 0.76));
}

.bond-overview-card.bond-pink {
  border-color: rgba(236, 72, 153, 0.18);
  background: linear-gradient(135deg, rgba(255, 193, 215, 0.62), rgba(255, 255, 255, 0.76));
}

.bond-overview-card.bond-orange {
  border-color: rgba(234, 88, 12, 0.16);
  background: linear-gradient(135deg, rgba(253, 186, 116, 0.54), rgba(255, 255, 255, 0.76));
}

.bond-overview-card.bond-yellow {
  border-color: rgba(202, 138, 4, 0.16);
  background: linear-gradient(135deg, rgba(254, 240, 138, 0.52), rgba(255, 255, 255, 0.76));
}

.bond-overview-card.bond-none {
  background: rgba(255, 255, 255, 0.7);
}

.bond-overview-card.is-bond-locked {
  cursor: not-allowed;
  filter: grayscale(0.65);
  opacity: 0.62;
}

.bond-overview-card.is-bond-locked select {
  cursor: not-allowed;
}

.bond-overview-value small {
  margin-left: 0.25rem;
  color: rgba(94, 104, 96, 0.68);
  font-size: 0.64rem;
  font-weight: 900;
}

.rank-summary-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.equipment-bulk-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.equipment-bulk-actions summary,
.equipment-bulk-menu button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(36, 83, 59, 0.16);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--green-dark);
  background: rgba(255, 253, 247, 0.78);
  font-size: 0.68rem;
  font-weight: 900;
}

.equipment-bulk-actions summary,
.equipment-bulk-menu button {
  cursor: pointer;
}

.equipment-bulk-actions summary {
  list-style: none;
}

.equipment-bulk-actions summary::-webkit-details-marker {
  display: none;
}

.equipment-bulk-actions[open] summary {
  border-color: rgba(69, 130, 91, 0.32);
  background: rgba(225, 244, 226, 0.95);
}

.equipment-bulk-menu {
  position: absolute;
  z-index: 30;
  right: 0;
  top: calc(100% + 6px);
  min-width: 210px;
  display: grid;
  grid-template-columns: repeat(4, minmax(42px, 1fr));
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(36, 83, 59, 0.16);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.98);
  box-shadow: 0 14px 30px rgba(47, 68, 49, 0.16);
}

.equipment-bulk-menu button:nth-child(-n + 2) {
  grid-column: span 2;
}

.equipment-bulk-menu button {
  min-height: 30px;
  padding: 0 8px;
  background: rgba(62, 119, 84, 0.08);
}

.dashboard-page .equipment-grid {
  display: block;
}

.equipment-orbit {
  position: relative;
  width: min(680px, 100%);
  height: 430px;
  margin: 0 auto 18px;
  border-radius: 36px;
  background: transparent;
}

.equipment-center-apostle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 164px;
  display: grid;
  justify-items: center;
  gap: 3px;
  transform: translate(-50%, -50%);
  color: var(--green-dark);
}

.equipment-center-portrait {
  width: 150px;
  height: 150px;
  overflow: hidden;
  border: 4px solid rgba(117, 176, 83, 0.56);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(207, 232, 173, 0.9), rgba(255, 248, 216, 0.9));
  box-shadow:
    0 0 0 3px rgba(255, 253, 247, 0.9),
    0 8px 22px rgba(47, 68, 49, 0.16);
}

.equipment-center-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.equipment-center-apostle strong {
  font-size: 0.88rem;
}

.equipment-center-apostle > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.dashboard-page .equipment-orbit-slot {
  position: absolute;
  width: 112px;
  min-height: 122px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "kind tier"
    "icon icon"
    "controls controls";
  align-content: start;
  gap: 3px;
  border: 2px solid color-mix(in srgb, var(--equipment-rank-color) 34%, rgba(255, 255, 255, 0.4));
  border-radius: 24px;
  padding: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 58%),
    color-mix(in srgb, var(--equipment-rank-color) 10%, rgba(255, 253, 247, 0.9));
  box-shadow: 0 8px 20px rgba(47, 68, 49, 0.12);
  transform: translate(-50%, -50%);
}

.dashboard-page .equipment-orbit-slot.slot-1 { left: 31%; top: 16%; }
.dashboard-page .equipment-orbit-slot.slot-2 { left: 69%; top: 16%; }
.dashboard-page .equipment-orbit-slot.slot-3 { left: 18%; top: 50%; }
.dashboard-page .equipment-orbit-slot.slot-4 { left: 82%; top: 50%; }
.dashboard-page .equipment-orbit-slot.slot-5 { left: 31%; top: 84%; }
.dashboard-page .equipment-orbit-slot.slot-6 { left: 69%; top: 84%; }

.dashboard-page .equipment-orbit-slot .kind {
  grid-area: kind;
  overflow: hidden;
  color: var(--green-dark);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.65rem;
}

.dashboard-page .equipment-orbit-slot .tier {
  grid-area: tier;
  margin: 0;
  color: var(--muted);
  font-size: 0.65rem;
}

.dashboard-page .equipment-orbit-slot .equip-icon {
  position: static;
  grid-area: icon;
  width: 66px;
  height: 66px;
  justify-self: center;
  object-fit: contain;
}

.dashboard-page .equipment-orbit-slot .equip-controls {
  grid-area: controls;
  justify-content: center;
  gap: 5px;
  margin-top: 1px;
}

.dashboard-page .equipment-orbit-slot .equip-toggle {
  position: relative;
  border-radius: 8px;
  padding: 4px 6px;
  color: var(--green-dark);
  background: color-mix(in srgb, var(--equipment-rank-color) 14%, rgba(255, 255, 255, 0.56));
  cursor: pointer;
}

.dashboard-page .equipment-orbit-slot .equip-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dashboard-page .equipment-orbit-slot .equip-toggle:has(input:not(:checked)) {
  color: var(--muted);
  background: rgba(68, 82, 65, 0.08);
}

.dashboard-page .equipment-orbit-slot .equip-enhance {
  min-height: 26px;
  padding: 0 4px;
  font-size: 0.68rem;
}

.equipment-value-table {
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(36, 83, 59, 0.12);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.62);
}

.equipment-value-table table {
  width: max-content;
  min-width: min(100%, 720px);
  border-collapse: collapse;
}

.equipment-value-table th,
.equipment-value-table td {
  min-width: 92px;
  border-bottom: 1px solid rgba(36, 83, 59, 0.09);
  padding: 8px 12px;
  font-size: 0.74rem;
  text-align: center;
}

.equipment-value-table thead th {
  color: var(--muted);
  background: rgba(231, 241, 222, 0.5);
  font-size: 0.67rem;
}

.equipment-value-table tbody th {
  min-width: 150px;
  color: var(--green-dark);
  text-align: left;
}

.equipment-value-table .value {
  color: #245f42;
  font-weight: 950;
}

.equipment-value-table tr.is-disabled {
  opacity: 0.48;
}

.equipment-value-table tr:last-child th,
.equipment-value-table tr:last-child td {
  border-bottom: 0;
}

.equipment-rank-effect {
  margin-top: 16px;
  border-top: 1px solid rgba(36, 83, 59, 0.12);
  padding-top: 14px;
}

.equipment-rank-effect-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.equipment-rank-effect-head h3,
.equipment-rank-effect-head p {
  margin: 0;
}

.equipment-rank-effect-head h3 {
  color: var(--green-dark);
  font-size: 0.94rem;
}

.board-open-global {
  min-height: 34px;
  border: 1px solid rgba(36, 83, 59, 0.2);
  border-radius: 11px;
  padding: 0 12px;
  color: var(--green-dark);
  background: rgba(62, 119, 84, 0.08);
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
}

.dashboard-bottom-bar {
  position: fixed;
  z-index: 80;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  min-height: var(--dashboard-bar-height);
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-top: 1px solid rgba(36, 83, 59, 0.2);
  border-radius: 0;
  padding: 3px max(8px, env(safe-area-inset-right)) calc(3px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: rgba(255, 250, 240, 0.94);
  box-shadow: 0 -10px 30px rgba(39, 57, 42, 0.18);
  backdrop-filter: blur(14px);
}

:root[data-theme="dark"] .dashboard-bottom-bar {
  border-top-color: rgba(166, 180, 197, 0.2);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.46);
}

.dashboard-bottom-bar button,
.bottom-save-menu summary,
.bottom-global-menu summary {
  height: var(--dashboard-bottom-control-height);
  min-height: 0;
  box-sizing: border-box;
  border: 1px solid rgba(36, 83, 59, 0.16);
  border-radius: 11px;
  padding: 0 12px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.66);
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.12;
  cursor: pointer;
}

:root[data-theme="dark"] .dashboard-bottom-bar button,
:root[data-theme="dark"] .bottom-save-menu summary,
:root[data-theme="dark"] .bottom-global-menu summary {
  color: var(--green-dark);
  border-color: rgba(166, 180, 197, 0.22);
  background: rgba(20, 34, 52, 0.84);
}

:root[data-theme="dark"] .dashboard-bottom-bar button.is-active {
  color: #ffffff !important;
  border-color: rgba(196, 181, 253, 0.55) !important;
  background: linear-gradient(135deg, var(--dashboard-dark-primary), var(--dashboard-dark-accent)) !important;
  box-shadow:
    0 0 0 2px rgba(8, 14, 24, 0.86),
    0 8px 18px rgba(99, 102, 241, 0.24);
}

.dashboard-bottom-bar button.is-active {
  color: #fff !important;
  border-color: rgba(47, 119, 78, 0.58) !important;
  background: linear-gradient(135deg, #4f9a63, #2f7650) !important;
  box-shadow:
    0 0 0 2px rgba(255, 253, 247, 0.9),
    0 8px 18px rgba(47, 119, 78, 0.28);
  transform: translateY(-2px);
}

.dashboard-bottom-bar button.is-active strong,
.dashboard-bottom-bar button.is-active small {
  color: inherit !important;
}

:root[data-theme="dark"] .dashboard-bottom-bar button.is-active {
  color: #ffffff !important;
  border-color: rgba(196, 181, 253, 0.55) !important;
  background: linear-gradient(135deg, var(--dashboard-dark-primary), var(--dashboard-dark-accent)) !important;
  box-shadow:
    0 0 0 2px rgba(8, 14, 24, 0.86),
    0 8px 18px rgba(99, 102, 241, 0.24);
}

.bottom-apostle-button {
  --bottom-apostle-color: var(--green);
  width: clamp(170px, 28vw, 240px);
  min-width: 170px;
  max-width: 240px;
  flex: 0 1 240px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  padding: 4px 12px 4px 5px !important;
  color: var(--ink) !important;
  border-color: color-mix(in srgb, var(--bottom-apostle-color) 48%, white) !important;
  background: color-mix(in srgb, var(--bottom-apostle-color) 30%, white) !important;
  text-align: left;
}

:root[data-theme="dark"] .bottom-apostle-button {
  color: rgba(248, 250, 252, 0.96) !important;
  border-color: color-mix(in srgb, var(--bottom-apostle-color) 72%, rgba(255, 255, 255, 0.28)) !important;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--bottom-apostle-color) 42%, rgba(255, 255, 255, 0.12)),
      color-mix(in srgb, var(--bottom-apostle-color) 26%, rgba(15, 23, 42, 0.42))) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16);
}

.bottom-apostle-button.personality-pure { --bottom-apostle-color: var(--personality-pure); }
.bottom-apostle-button.personality-calm { --bottom-apostle-color: var(--personality-calm); }
.bottom-apostle-button.personality-madness { --bottom-apostle-color: var(--personality-madness); }
.bottom-apostle-button.personality-active { --bottom-apostle-color: var(--personality-active); }
.bottom-apostle-button.personality-gloomy { --bottom-apostle-color: var(--personality-gloomy); }

.bottom-apostle-button img {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: block;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.52);
}

.bottom-apostle-button span {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 1px;
}

.bottom-apostle-button small {
  font-size: 0.57rem;
  opacity: 0.78;
}

.bottom-apostle-button strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.76rem;
}

.bottom-save-menu {
  position: relative;
}

.bottom-save-menu,
.bottom-global-menu {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  height: var(--dashboard-bottom-control-height);
}

.bottom-save-menu[open],
.bottom-global-menu[open] {
  z-index: 90;
}

.bottom-save-menu summary,
.bottom-global-menu summary {
  display: grid;
  place-items: center;
  line-height: 1.02;
  list-style: none;
}

.bottom-save-menu summary.bottom-save-trigger {
  display: inline-flex;
  width: 112px;
  min-width: 112px;
  flex: 0 0 112px;
  align-items: center;
  justify-content: flex-start;
  padding-inline: 2px 6px !important;
}

.bottom-save-menu summary.bottom-save-trigger strong {
  position: relative;
  display: grid;
  gap: 1px;
  align-items: center;
}

.state-slot-indicator {
  justify-self: start;
  min-width: 1.45em;
  border-radius: 999px;
  padding: 1px 6px;
  color: #ffffff;
  background: #4f9a63;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1.08;
  text-align: center;
}

.state-current-slot {
  min-width: 0;
  border-radius: 9px;
  padding: 5px 7px;
  color: #2f6046;
  background: rgba(62, 119, 84, 0.08);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-current-slot.is-dirty {
  color: #9a4c20;
  background: rgba(216, 128, 40, 0.13);
}

.bottom-save-menu.is-dirty .state-slot-indicator {
  color: #fff8ec;
  background: linear-gradient(135deg, #d68028, #b95536);
  box-shadow: 0 0 0 2px rgba(255, 202, 131, 0.34);
}

.bottom-global-menu summary strong {
  display: block;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.02;
  text-align: center;
}

.bottom-save-menu summary::-webkit-details-marker,
.bottom-global-menu summary::-webkit-details-marker {
  display: none;
}

.bottom-save-menu[open] summary,
.bottom-global-menu[open] summary,
.bottom-global-menu.is-active summary {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.bottom-save-menu[open] summary.bottom-save-trigger {
  color: #1d2356 !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

.bottom-save-popover,
.bottom-global-popover {
  position: absolute;
  z-index: 100;
  left: 50%;
  bottom: calc(100% + 12px);
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  border: 1px solid rgba(36, 83, 59, 0.18);
  border-radius: 16px;
  padding: 11px;
  background: #fffaf0;
  box-shadow: 0 14px 38px rgba(39, 57, 42, 0.24);
}

:root[data-theme="dark"] .bottom-save-menu[open] summary,
:root[data-theme="dark"] .bottom-global-menu[open] summary,
:root[data-theme="dark"] .bottom-global-menu.is-active summary,
:root[data-theme="dark"] .bottom-save-slots button.is-selected,
:root[data-theme="dark"] .bottom-save-actions #save-state-slot {
  color: #ffffff;
  border-color: rgba(196, 181, 253, 0.55);
  background: linear-gradient(135deg, var(--dashboard-dark-primary), var(--dashboard-dark-accent));
}

:root[data-theme="dark"] .bottom-save-popover,
:root[data-theme="dark"] .bottom-global-popover {
  border-color: rgba(166, 180, 197, 0.22);
  background: rgba(15, 26, 42, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.44);
}

.bottom-save-popover {
  width: 268px;
  right: 0;
  left: auto;
  transform: none;
  font-family: inherit;
}

.bottom-save-menu.has-external-conflict .state-slot-indicator,
.bottom-save-slots button.has-external-conflict {
  color: #fff;
  border-color: rgba(177, 48, 48, 0.78);
  background: linear-gradient(135deg, #c44b45, #8f2934);
  box-shadow: 0 0 0 2px rgba(213, 77, 77, 0.24);
}

.bottom-save-popover button {
  appearance: none;
  box-sizing: border-box;
  border: 1px solid rgba(36, 83, 59, 0.16);
  border-radius: 11px;
  padding: 0 10px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.66);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1.12;
  cursor: pointer;
}

.bottom-save-popover button:hover:not(:disabled) {
  border-color: rgba(36, 83, 59, 0.38);
  background: rgba(255, 255, 255, 0.92);
}

:root[data-theme="dark"] .bottom-save-popover button {
  color: var(--green-dark);
  border-color: rgba(166, 180, 197, 0.22);
  background: rgba(20, 34, 52, 0.84);
}

:root[data-theme="dark"] .bottom-save-popover button:hover:not(:disabled) {
  border-color: rgba(196, 181, 253, 0.42);
  background: rgba(35, 48, 70, 0.96);
}

.bottom-save-popover.is-portaled {
  position: fixed;
  z-index: 120;
  inset: auto auto calc(var(--dashboard-bar-height, 68px) + 12px) var(--bottom-save-popover-left, 2px);
  display: none;
  max-height: calc(100dvh - var(--dashboard-bar-height, 68px) - 24px);
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  transform: none;
}

.bottom-save-popover.is-portaled.is-open {
  display: grid;
}

.bottom-global-menu {
  position: relative;
}

.bottom-global-menu summary {
  min-width: 74px;
}

.bottom-global-menu summary strong {
  display: block;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.02;
  text-align: center;
}

.bottom-global-popover {
  width: 210px;
  grid-template-columns: 1fr 1fr;
}

.bottom-global-popover button {
  min-height: 36px;
  padding: 0 10px;
}

.bottom-save-label {
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 900;
}

.bottom-save-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bottom-save-section {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(36, 83, 59, 0.1);
  border-radius: 12px;
  padding: 7px;
  background: rgba(62, 119, 84, 0.055);
}

.bottom-save-section[hidden] {
  display: none !important;
}

:root[data-theme="dark"] .bottom-save-section {
  border-color: rgba(166, 180, 197, 0.18);
  background: rgba(255, 255, 255, 0.045);
}

:root[data-theme="dark"] .state-current-slot {
  color: #d9f5e3;
  background: rgba(94, 164, 116, 0.13);
}

:root[data-theme="dark"] .state-current-slot.is-dirty {
  color: #fed7aa;
  background: rgba(251, 146, 60, 0.16);
}

.bottom-save-section-title {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
}

.bottom-save-head small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.62rem;
  font-weight: 800;
}

.bottom-save-slots {
  display: grid;
  gap: 5px;
}

.bottom-save-actions,
.bottom-transfer-actions {
  display: flex;
  gap: 5px;
}

.bottom-save-slots button {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 5px 8px 5px 5px;
  text-align: left;
  font-weight: 950;
}

.state-slot-number {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #2f6f4c;
  background: rgba(66, 130, 96, 0.12);
  font-size: 0.78rem;
}

.state-slot-main {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.state-slot-main strong,
.state-slot-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-slot-main strong {
  color: var(--text);
  font-size: 0.72rem;
}

.state-slot-main small {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
}

.bottom-save-name {
  display: grid;
  gap: 4px;
}

.bottom-save-name[hidden] {
  display: none !important;
}

.bottom-save-name span {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 900;
}

.bottom-save-name input {
  width: 100%;
  border: 1px solid rgba(36, 83, 59, 0.18);
  border-radius: 9px;
  padding: 7px 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  outline: none;
}

:root[data-theme="dark"] .bottom-save-name input {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.82);
}

.bottom-save-section-actions {
  display: flex;
  justify-content: flex-end;
}

.bottom-save-section-actions .secondary {
  min-height: 30px;
  padding-inline: 12px;
}

:root[data-theme="dark"] .state-slot-number {
  color: #d9f5e3;
  background: rgba(94, 164, 116, 0.18);
}

:root[data-theme="dark"] .state-slot-main strong {
  color: #f8fafc;
}

:root[data-theme="dark"] .state-slot-main small {
  color: #b6c2d1;
}

.bottom-save-slots button.is-selected {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.bottom-save-slots button.is-selected .state-slot-number {
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.9);
}

.bottom-save-slots button.is-selected .state-slot-main strong,
.bottom-save-slots button.is-selected .state-slot-main small {
  color: #ffffff;
}

.bottom-save-slots button.is-current {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.64), 0 5px 14px rgba(47, 118, 80, 0.18);
}

.bottom-save-slots button.is-dirty {
  color: #fff8ec;
  border-color: rgba(190, 126, 48, 0.7);
  background: linear-gradient(135deg, #d89640, #bd5c3a);
}

.bottom-save-slots button.is-dirty::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff4c2;
}

.bottom-save-slots button.has-data::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.bottom-save-actions button {
  flex: 1;
  min-height: 34px;
}

.bottom-save-actions #save-state-slot {
  color: #2f6f4c;
  border-color: rgba(66, 130, 96, 0.22);
  background: rgba(66, 130, 96, 0.08);
}

.bottom-save-actions button.is-selected {
  color: #fff;
  border-color: rgba(47, 118, 80, 0.58);
  background: linear-gradient(135deg, #4f9a63, #2f7650);
  box-shadow: 0 5px 13px rgba(47, 118, 80, 0.18);
}

.bottom-save-menu[data-slot-mode="load"] .bottom-save-actions button.is-selected,
.bottom-save-popover[data-slot-mode="load"] .bottom-save-actions button.is-selected {
  border-color: rgba(90, 112, 190, 0.5);
  background: linear-gradient(135deg, #6385cc, #465aa5);
}

.bottom-save-menu[data-slot-mode="delete"] .bottom-save-actions button.is-selected,
.bottom-save-popover[data-slot-mode="delete"] .bottom-save-actions button.is-selected {
  border-color: rgba(184, 91, 77, 0.48);
  background: linear-gradient(135deg, #ca625b, #a74644);
}

.bottom-save-actions .danger {
  color: #9c443d;
  border-color: rgba(184, 91, 77, 0.24);
  background: rgba(184, 91, 77, 0.06);
}

.bottom-transfer-actions {
  border-top: 1px solid rgba(36, 83, 59, 0.1);
  padding-top: 8px;
}

.bottom-transfer-actions button {
  min-height: 32px;
  flex: 1;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.66rem;
}

.bottom-save-actions button:disabled {
  opacity: 0.38;
  cursor: default;
}

:root[data-theme="dark"] .state-slot-indicator {
  color: #ecfeff;
  background: linear-gradient(135deg, #5caa78, #2f7650);
}

:root[data-theme="dark"] .bottom-save-menu.is-dirty .state-slot-indicator,
:root[data-theme="dark"] .bottom-save-slots button.is-dirty {
  color: #fff7ed !important;
  border-color: rgba(251, 146, 60, 0.48) !important;
  background: linear-gradient(135deg, #c2410c, #b45309) !important;
}

:root[data-theme="dark"] .bottom-save-actions button.is-selected {
  color: #ffffff !important;
  border-color: rgba(134, 239, 172, 0.45) !important;
  background: linear-gradient(135deg, #2f7650, #23543f) !important;
}

:root[data-theme="dark"] .bottom-save-menu[data-slot-mode="load"] .bottom-save-actions button.is-selected,
:root[data-theme="dark"] .bottom-save-popover[data-slot-mode="load"] .bottom-save-actions button.is-selected {
  border-color: rgba(147, 197, 253, 0.42) !important;
  background: linear-gradient(135deg, #345a9b, #293d75) !important;
}

:root[data-theme="dark"] .bottom-save-menu[data-slot-mode="delete"] .bottom-save-actions button.is-selected,
:root[data-theme="dark"] .bottom-save-popover[data-slot-mode="delete"] .bottom-save-actions button.is-selected {
  border-color: rgba(252, 165, 165, 0.42) !important;
  background: linear-gradient(135deg, #9f3f45, #732d36) !important;
}

.bottom-setting-group {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(36, 83, 59, 0.12);
  border-radius: 15px;
  padding: 4px;
  background: rgba(62, 119, 84, 0.06);
}

.bottom-setting-group > span {
  display: grid;
  place-items: center;
  min-width: 38px;
  padding: 0 5px;
  color: var(--muted);
  font-weight: 900;
  line-height: 1;
}

.bottom-setting-group > span strong {
  color: var(--green-dark);
  font-size: 0.67rem;
}

.bottom-setting-group > span small {
  margin-top: 2px;
  font-size: 0.55rem;
}

.research-quick-button {
  border-color: rgba(128, 89, 168, 0.22) !important;
  color: #67438b !important;
  background: rgba(128, 89, 168, 0.08) !important;
}

.card-quick-button {
  border-color: rgba(190, 89, 112, 0.22) !important;
  color: #93485b !important;
  background: rgba(218, 106, 132, 0.08) !important;
}

.board-quick-button {
  border-color: rgba(66, 130, 96, 0.22) !important;
  color: #2f6f4c !important;
  background: rgba(66, 130, 96, 0.08) !important;
}

.spell-quick-button {
  border-color: rgba(128, 89, 168, 0.22) !important;
  color: #67438b !important;
  background: rgba(128, 89, 168, 0.08) !important;
}

.artifact-quick-button {
  border-color: rgba(190, 126, 48, 0.24) !important;
  color: #8a5a1f !important;
  background: rgba(218, 158, 68, 0.1) !important;
}

.bottom-section-button {
  position: relative;
  isolation: isolate;
  flex: 0 0 86px;
  width: 86px;
  min-width: 86px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding-inline: 2px 6px !important;
  border-color: transparent !important;
  border-radius: 999px 12px 12px 999px !important;
  color: rgba(49, 95, 69, 0.78) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.bottom-save-menu summary.bottom-save-trigger {
  flex: 0 0 112px;
  width: 112px;
  min-width: 112px;
}

.bottom-section-button strong {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  text-align: left;
  white-space: nowrap;
  transform: translateY(5px);
}

.bottom-section-button strong span {
  position: relative;
  display: inline-block;
}

.bottom-section-button strong span::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -4px;
  right: -7px;
  bottom: -2px;
  height: 12px;
  border-radius: 999px;
  background: transparent;
  transition: background-color 0.16s ease, height 0.16s ease;
}

.bottom-section-icon {
  position: relative;
  z-index: 4;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  border-radius: 999px;
  border: 2px solid rgba(45, 111, 69, 0.22);
  background: linear-gradient(145deg, #82c98e, #3d8c5b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.bottom-section-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  filter: saturate(0.92) brightness(1.08);
}

.bottom-save-trigger {
  color: rgba(70, 73, 139, 0.82) !important;
}

.bottom-save-trigger .bottom-section-icon {
  border-color: rgba(94, 88, 181, 0.28);
  background: linear-gradient(145deg, #9ba8ff, #6a70d6);
}

.bottom-save-trigger .bottom-section-icon img {
  filter: saturate(1.05) brightness(1.08);
}

:root[data-theme="dark"] .bottom-save-trigger {
  color: rgba(207, 250, 254, 0.86) !important;
}

:root[data-theme="dark"] .bottom-save-trigger .bottom-section-icon {
  border-color: rgba(103, 232, 249, 0.42);
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.58), rgba(14, 116, 144, 0.42));
  box-shadow:
    0 0 0 2px rgba(8, 47, 73, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

:root[data-theme="dark"] .bottom-section-button {
  color: rgba(237, 245, 255, 0.68) !important;
  border-color: transparent !important;
  background: transparent !important;
}

:root[data-theme="dark"] .bottom-save-menu[open] summary.bottom-save-trigger {
  color: rgba(236, 254, 255, 0.96) !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .bottom-section-icon {
  border-color: rgba(196, 181, 253, 0.28);
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.5), rgba(236, 72, 153, 0.24));
}

.research-quick-button.is-active {
  border-color: rgba(128, 89, 168, 0.62) !important;
  background: linear-gradient(135deg, #8d62b0, #66408b) !important;
}

.board-quick-button.is-active {
  border-color: rgba(66, 130, 96, 0.62) !important;
  background: linear-gradient(135deg, #5caa78, #2f7650) !important;
}

.card-quick-button.is-active {
  border-color: rgba(190, 89, 112, 0.62) !important;
  background: linear-gradient(135deg, #c8647d, #93485b) !important;
}

.artifact-quick-button.is-active {
  border-color: rgba(190, 126, 48, 0.62) !important;
  background: linear-gradient(135deg, #d59a43, #8a5a1f) !important;
}

.spell-quick-button.is-active {
  border-color: rgba(128, 89, 168, 0.62) !important;
  background: linear-gradient(135deg, #8d62b0, #66408b) !important;
}

.bottom-theme-toggle {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  align-self: center;
  margin-left: auto;
  border-radius: 999px;
  padding: 0;
  color: #f97316;
  border-color: transparent;
  background: transparent;
  font-size: 0;
  font-weight: 950;
  line-height: 1;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.72),
    0 0 8px rgba(249, 115, 22, 0.42);
  box-shadow: none;
}

.bottom-theme-toggle[aria-pressed="true"] {
  color: #facc15;
  border-color: transparent;
  background: transparent;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 8px rgba(250, 204, 21, 0.48);
}

:root[data-theme="dark"] .bottom-theme-toggle {
  color: #facc15;
  border-color: transparent;
  background: transparent;
}

.bottom-theme-toggle:hover,
.bottom-theme-toggle:focus-visible,
:root[data-theme="dark"] .bottom-theme-toggle:hover,
:root[data-theme="dark"] .bottom-theme-toggle:focus-visible {
  border-color: transparent;
  background: transparent;
  transform: translateY(-1px) scale(1.06);
}

.bottom-theme-toggle::before,
.bottom-theme-toggle::after {
  content: "";
  position: absolute;
  display: block;
  pointer-events: none;
}

.bottom-theme-toggle::before {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #f97316;
  box-shadow:
    0 0 0 2px rgba(255, 237, 213, 0.58),
    0 0 10px rgba(249, 115, 22, 0.62);
}

.bottom-theme-toggle::after {
  width: 25px;
  height: 25px;
  background:
    linear-gradient(#f97316, #f97316) 50% 0 / 3px 6px no-repeat,
    linear-gradient(#f97316, #f97316) 50% 100% / 3px 6px no-repeat,
    linear-gradient(90deg, #f97316, #f97316) 0 50% / 6px 3px no-repeat,
    linear-gradient(90deg, #f97316, #f97316) 100% 50% / 6px 3px no-repeat,
    linear-gradient(45deg, transparent 40%, #f97316 42% 58%, transparent 60%) 2px 2px / 7px 7px no-repeat,
    linear-gradient(45deg, transparent 40%, #f97316 42% 58%, transparent 60%) 16px 16px / 7px 7px no-repeat,
    linear-gradient(-45deg, transparent 40%, #f97316 42% 58%, transparent 60%) 16px 2px / 7px 7px no-repeat,
    linear-gradient(-45deg, transparent 40%, #f97316 42% 58%, transparent 60%) 2px 16px / 7px 7px no-repeat;
  filter: drop-shadow(0 0 5px rgba(249, 115, 22, 0.44));
}

.bottom-theme-toggle[aria-pressed="true"]::before {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #facc15;
  box-shadow:
    0 0 10px rgba(250, 204, 21, 0.55);
  transform: rotate(-18deg);
}

.bottom-theme-toggle[aria-pressed="true"]::after {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--dashboard-dark-panel);
  transform: translate(7px, -3px) rotate(-18deg);
  filter: none;
}

:root[data-theme="dark"] .research-quick-button {
  border-color: rgba(196, 181, 253, 0.34) !important;
  color: #ddd6fe !important;
  background: rgba(124, 58, 237, 0.16) !important;
}

:root[data-theme="dark"] .board-quick-button {
  border-color: rgba(134, 239, 172, 0.34) !important;
  color: #bbf7d0 !important;
  background: rgba(34, 197, 94, 0.14) !important;
}

:root[data-theme="dark"] .card-quick-button {
  border-color: rgba(251, 207, 232, 0.32) !important;
  color: #fbcfe8 !important;
  background: rgba(236, 72, 153, 0.14) !important;
}

:root[data-theme="dark"] .artifact-quick-button {
  border-color: rgba(253, 230, 138, 0.36) !important;
  color: #fde68a !important;
  background: rgba(245, 158, 11, 0.16) !important;
}

:root[data-theme="dark"] .spell-quick-button {
  border-color: rgba(216, 180, 254, 0.36) !important;
  color: #e9d5ff !important;
  background: rgba(168, 85, 247, 0.16) !important;
}

:root[data-theme="dark"] .research-quick-button.is-active,
:root[data-theme="dark"] .board-quick-button.is-active,
:root[data-theme="dark"] .card-quick-button.is-active,
:root[data-theme="dark"] .artifact-quick-button.is-active,
:root[data-theme="dark"] .spell-quick-button.is-active {
  color: #ffffff !important;
}

.dashboard-bottom-bar .bottom-section-button.is-active {
  color: #103f27 !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: translateY(-1px);
}

.dashboard-bottom-bar .bottom-section-button.is-active strong span::before {
  height: 19px;
  background: linear-gradient(90deg, rgba(82, 159, 101, 0.58), rgba(82, 159, 101, 0.24));
}

.dashboard-bottom-bar .bottom-save-menu[open] .bottom-save-trigger strong span::before {
  height: 19px;
  background: linear-gradient(90deg, rgba(80, 164, 214, 0.58), rgba(80, 164, 214, 0.22));
}

.dashboard-bottom-bar .bottom-section-button.is-active .bottom-section-icon {
  border-color: rgba(30, 99, 54, 0.54);
  box-shadow:
    0 0 0 3px rgba(82, 159, 101, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

:root[data-theme="dark"] .dashboard-bottom-bar .bottom-section-button.is-active {
  color: #f4f7ff !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .dashboard-bottom-bar .bottom-section-button.is-active strong span::before {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.48), rgba(236, 72, 153, 0.22));
}

:root[data-theme="dark"] .dashboard-bottom-bar .bottom-save-menu[open] .bottom-save-trigger strong span::before {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.54), rgba(14, 165, 233, 0.18));
}

:root[data-theme="dark"] .dashboard-bottom-bar .bottom-section-button.is-active .bottom-section-icon {
  border-color: rgba(196, 181, 253, 0.72);
  box-shadow:
    0 0 0 3px rgba(99, 102, 241, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.dashboard-page .dashboard-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.dashboard-persistent-profile {
  align-items: center;
  scroll-margin-top: calc(var(--dashboard-top-control-height) + 12px);
}

.dashboard-persistent-profile,
[data-dashboard-panel="equipment"] {
  --profile-personality-color: var(--green);
}

.dashboard-persistent-profile.personality-純粋,
[data-dashboard-panel="equipment"].personality-純粋 { --profile-personality-color: var(--personality-pure); }
.dashboard-persistent-profile.personality-冷静,
[data-dashboard-panel="equipment"].personality-冷静 { --profile-personality-color: var(--personality-calm); }
.dashboard-persistent-profile.personality-狂気,
[data-dashboard-panel="equipment"].personality-狂気 { --profile-personality-color: var(--personality-madness); }
.dashboard-persistent-profile.personality-活発,
[data-dashboard-panel="equipment"].personality-活発 { --profile-personality-color: var(--personality-active); }
.dashboard-persistent-profile.personality-憂鬱,
[data-dashboard-panel="equipment"].personality-憂鬱 { --profile-personality-color: var(--personality-gloomy); }

[data-dashboard-panel="equipment"] {
  --equipment-rank-color: #9ca3af;
}

[data-dashboard-panel="equipment"].rank-gray { --equipment-rank-color: #9ca3af; }
[data-dashboard-panel="equipment"].rank-green { --equipment-rank-color: #4ade80; }
[data-dashboard-panel="equipment"].rank-blue { --equipment-rank-color: #60a5fa; }
[data-dashboard-panel="equipment"].rank-purple { --equipment-rank-color: #a78bfa; }
[data-dashboard-panel="equipment"].rank-gold { --equipment-rank-color: #facc15; }

.dashboard-persistent-profile[class*="personality-"] {
  border-color: var(--line);
  background: var(--paper);
}

.dashboard-persistent-profile[class*="personality-"] .portrait-frame.dashboard-portrait,
[data-dashboard-panel="equipment"][class*="personality-"] .equipment-center-portrait {
  border-color: color-mix(in srgb, var(--profile-personality-color) 50%, white);
  background: color-mix(in srgb, var(--profile-personality-color) 18%, rgba(255, 253, 247, 0.96));
}

[data-dashboard-panel="equipment"][class*="rank-"] .equipment-center-portrait {
  border-color: color-mix(in srgb, var(--profile-personality-color) 50%, white);
  background: color-mix(in srgb, var(--profile-personality-color) 18%, rgba(255, 253, 247, 0.96));
}

.dashboard-page .dashboard-rail {
  position: sticky;
  z-index: 12;
  top: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  align-self: stretch;
  border: 1px solid rgba(45, 111, 69, 0.16);
  border-radius: 20px;
  padding: 7px;
  background: rgba(255, 250, 240, 0.92);
  box-shadow: 0 10px 28px rgba(42, 67, 43, 0.12);
  backdrop-filter: blur(10px);
}

.dashboard-page .dashboard-rail button,
.dashboard-page .dashboard-rail .rail-equipment {
  width: 100%;
  margin: 0;
}

.dashboard-page .dashboard-rail button {
  min-height: 48px;
  justify-content: center;
  border-radius: 15px;
  padding: 4px 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.46);
}

.dashboard-page .dashboard-rail button.is-active {
  color: #17452d;
  border: 1px solid rgba(47, 124, 71, 0.34);
  background: linear-gradient(145deg, rgba(111, 190, 119, 0.38), rgba(242, 235, 144, 0.24));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45), 0 8px 18px rgba(45, 111, 69, 0.16);
}

.dashboard-page .dashboard-rail-icon {
  width: 38px;
  height: 38px;
}

.dashboard-page .dashboard-rail-icon img {
  width: 28px;
  height: 28px;
}

.dashboard-page .dashboard-rail button strong {
  font-size: 0.72rem;
}

:root[data-theme="dark"] .dashboard-page .dashboard-rail {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .dashboard-page .dashboard-rail button {
  color: rgba(226, 232, 240, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .dashboard-page .dashboard-rail button:hover:not(:disabled) {
  color: #f8fafc;
  border-color: rgba(196, 181, 253, 0.26);
  background: rgba(99, 102, 241, 0.12);
}

:root[data-theme="dark"] .dashboard-page .dashboard-rail button.is-active {
  color: #ffffff;
  border-color: rgba(196, 181, 253, 0.46);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.34), rgba(236, 72, 153, 0.18));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 8px 18px rgba(99, 102, 241, 0.18);
}

:root[data-theme="dark"] .dashboard-page .dashboard-rail button.is-active .dashboard-rail-icon {
  border-color: rgba(196, 181, 253, 0.72);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.profile-stars {
  display: flex;
  gap: 2px;
  margin: 0;
}

.profile-stars button {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.profile-stars button:focus-visible {
  outline: 2px solid rgba(62, 119, 84, 0.46);
  outline-offset: 2px;
  border-radius: 50%;
}

.profile-stars img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(72, 62, 22, 0.22));
}

.skill-slider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.skill-slider-field {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 32px;
  grid-template-areas:
    "icon label value"
    "icon range range";
  align-items: center;
  gap: 5px 8px;
  border: 1px solid rgba(94, 99, 118, 0.14);
  border-radius: 16px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.skill-slider-field .skill-setting-icon {
  grid-area: icon;
}

.skill-slider-field > span {
  grid-area: label;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.skill-slider-field input {
  grid-area: range;
  width: 100%;
  accent-color: #55a978;
}

.skill-slider-field output {
  grid-area: value;
  justify-self: end;
  min-width: 28px;
  border-radius: 999px;
  padding: 2px 7px;
  color: #24533b;
  background: rgba(129, 205, 147, 0.22);
  font-size: 0.78rem;
  font-weight: 950;
  text-align: center;
}

.skill-info-list,
.aside-info-list {
  display: grid;
  gap: 9px;
}

.skill-info-card,
.aside-info-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(45, 111, 69, 0.13);
  border-radius: 17px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.52);
}

.skill-info-icon,
.aside-info-icon,
.aside-rank-chip,
.skill-info-icon-placeholder {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(83, 158, 100, 0.15);
  overflow: hidden;
  font-weight: 950;
}

.skill-info-icon img,
.aside-info-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aside-rank-chip {
  color: #275139;
  background: linear-gradient(145deg, rgba(141, 207, 154, 0.42), rgba(250, 236, 142, 0.35));
}

.skill-info-title {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  align-items: baseline;
}

.skill-info-title strong,
.aside-info-body strong {
  color: var(--green-dark);
  font-size: 0.9rem;
}

.skill-info-title span,
.aside-info-body > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.skill-info-title em {
  margin-left: auto;
  border-radius: 999px;
  padding: 2px 7px;
  color: #2b5b41;
  background: rgba(129, 205, 147, 0.18);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 950;
}

.skill-info-body p,
.aside-info-body p {
  margin: 4px 0 0;
  color: #425349;
  font-size: 0.76rem;
  line-height: 1.5;
}

.skill-info-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.skill-info-effects span {
  border: 1px solid rgba(52, 101, 73, 0.13);
  border-radius: 999px;
  padding: 3px 7px;
  color: #365342;
  background: rgba(241, 249, 237, 0.8);
  font-size: 0.68rem;
  font-weight: 800;
}

.aside-info-card.is-empty {
  opacity: 0.58;
}

.aside-tier-panel {
  margin-top: 14px;
  padding-top: 4px;
}

.aside-tier-panel h3 {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 0.9rem;
}

.dashboard-page .aside-tier-table {
  min-width: min(100%, 460px);
}

.dashboard-page .aside-tier-table th,
.dashboard-page .aside-tier-table td {
  text-align: center;
}

.dashboard-page .aside-tier-table tbody th {
  color: var(--green-dark);
  text-align: left;
}

.aside-tier-source {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: right;
}

.card-manager-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  border: 1px solid rgba(190, 89, 112, 0.12);
  border-radius: 18px;
  padding: 10px;
  background: linear-gradient(135deg, rgba(255, 250, 246, 0.9), rgba(255, 239, 246, 0.72));
}

.card-manager-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(190, 89, 112, 0.18);
  border-radius: 999px;
  background: rgba(255, 246, 248, 0.78);
}

.card-manager-tabs button {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: #9d4960;
  background: transparent;
  font-weight: 900;
}

.card-manager-tabs button.is-active {
  color: #fff;
  background: linear-gradient(135deg, #e98098, #b65a70);
}

.card-manager-owned-filter {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid rgba(190, 89, 112, 0.18);
  border-radius: 999px;
  color: #7c4050;
  background: rgba(255, 250, 252, 0.88);
  font-size: 0.78rem;
  font-weight: 850;
}

.card-manager-bulk-tools {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.card-manager-bulk-tools > button {
  min-height: 34px;
  border: 1px solid rgba(190, 89, 112, 0.2);
  border-radius: 999px;
  padding: 0 12px;
  color: #7c4050;
  background: rgba(255, 250, 252, 0.9);
  font-size: 0.78rem;
  font-weight: 900;
}

.card-manager-bulk-tools > button:hover {
  background: rgba(255, 234, 241, 0.95);
}

.card-manager-select {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid rgba(190, 89, 112, 0.18);
  border-radius: 999px;
  color: #7c4050;
  background: rgba(255, 246, 248, 0.7);
  font-size: 0.76rem;
  font-weight: 850;
}

.card-manager-select select {
  min-height: 26px;
  border: 0;
  border-radius: 999px;
  color: #714553;
  background: rgba(255, 255, 255, 0.65);
  font-weight: 900;
}

.card-manager-search {
  min-height: 38px;
  display: flex;
  flex: 1 1 220px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(190, 89, 112, 0.16);
  border-radius: 999px;
  padding: 0 12px;
  color: #7c4050;
  background: rgba(255, 255, 255, 0.74);
  font-size: 0.78rem;
  font-weight: 850;
}

.card-manager-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #5a3440;
  background: transparent;
  font: inherit;
}

.card-manager-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  color: #7d4855;
  font-size: 0.78rem;
  font-weight: 850;
}

.card-manager-summary span {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 238, 243, 0.86);
}

.card-manager-grid {
  display: block;
}

.card-manager-kind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 12px;
  align-items: start;
  opacity: 1;
  transition: opacity 120ms ease;
}

.card-manager-kind-grid[hidden] {
  display: none !important;
}

.card-manager-kind-grid.is-preparing {
  opacity: 0;
}

.resource-card {
  --card-rarity-color: rgba(190, 89, 112, 0.22);
  --card-rarity-glow: rgba(90, 48, 56, 0.08);
  --card-name-panel-height: 33%;
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  max-width: 166px;
  transition: filter 140ms ease, opacity 140ms ease, transform 140ms ease;
}

:root[data-theme="dark"] .bottom-save-menu.has-external-conflict .state-slot-indicator,
:root[data-theme="dark"] .bottom-save-slots button.has-external-conflict {
  color: #fff7f7 !important;
  border-color: rgba(248, 113, 113, 0.58) !important;
  background: linear-gradient(135deg, #b91c1c, #7f1d1d) !important;
}

.resource-card-mobile-controls {
  display: none;
}

.resource-card.rarity-signature {
  --card-rarity-color: rgba(250, 204, 21, 0.82);
  --card-rarity-glow: rgba(234, 179, 8, 0.22);
}

.resource-card.rarity-legendary {
  --card-rarity-color: rgba(168, 85, 247, 0.78);
  --card-rarity-glow: rgba(126, 34, 206, 0.18);
}

.resource-card.rarity-unique {
  --card-rarity-color: rgba(59, 130, 246, 0.74);
  --card-rarity-glow: rgba(37, 99, 235, 0.16);
}

.resource-card.rarity-rare {
  --card-rarity-color: rgba(34, 197, 94, 0.72);
  --card-rarity-glow: rgba(22, 163, 74, 0.14);
}

.resource-card:not(.is-owned) .resource-card-bg,
.resource-card:not(.is-owned) .resource-card-image {
  filter: grayscale(0.95) brightness(0.72);
  opacity: 0.72;
}

.resource-card-image-wrap {
  position: relative;
  align-self: start;
  overflow: visible;
  border-radius: 12px;
  background: transparent;
  aspect-ratio: 5 / 6;
}

.resource-card-bg {
  position: absolute;
  z-index: 1;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  object-fit: fill;
  pointer-events: none;
}

.resource-card-image {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.resource-card-spell .resource-card-image-wrap {
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 8px 18px var(--card-rarity-glow);
}

.resource-card-spell.rarity-legendary .resource-card-image-wrap {
  border-color: rgba(167, 139, 250, 0.95);
  box-shadow:
    0 0 0 1px rgba(91, 33, 182, 0.3),
    0 0 18px rgba(124, 58, 237, 0.12);
}

.resource-card-spell.rarity-unique .resource-card-image-wrap {
  border-color: rgba(96, 165, 250, 0.95);
  box-shadow:
    0 0 0 1px rgba(29, 78, 216, 0.25),
    0 0 16px rgba(59, 130, 246, 0.12);
}

.resource-card-spell.rarity-rare .resource-card-image-wrap {
  border-color: rgba(74, 222, 128, 0.95);
  box-shadow:
    0 0 0 1px rgba(21, 128, 61, 0.24),
    0 0 16px rgba(34, 197, 94, 0.12);
}

.resource-card-spell.rarity-signature .resource-card-image-wrap {
  border-color: rgba(251, 191, 36, 0.96);
  box-shadow:
    0 0 0 1px rgba(180, 83, 9, 0.28),
    0 0 18px rgba(245, 158, 11, 0.16);
}

.resource-card-artifact .resource-card-image-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  padding-top: 12%;
  border: 4px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 8px 18px var(--card-rarity-glow);
}

.resource-card-artifact.rarity-legendary .resource-card-image-wrap {
  border-color: rgba(167, 139, 250, 0.95);
  box-shadow:
    0 0 0 1px rgba(91, 33, 182, 0.3),
    0 0 18px rgba(124, 58, 237, 0.12);
}

.resource-card-artifact.rarity-unique .resource-card-image-wrap {
  border-color: rgba(96, 165, 250, 0.95);
  box-shadow:
    0 0 0 1px rgba(29, 78, 216, 0.25),
    0 0 16px rgba(59, 130, 246, 0.12);
}

.resource-card-artifact.rarity-rare .resource-card-image-wrap {
  border-color: rgba(74, 222, 128, 0.95);
  box-shadow:
    0 0 0 1px rgba(21, 128, 61, 0.24),
    0 0 16px rgba(34, 197, 94, 0.12);
}

.resource-card-artifact.rarity-signature .resource-card-image-wrap {
  border-color: rgba(251, 191, 36, 0.96);
  box-shadow:
    0 0 0 1px rgba(180, 83, 9, 0.28),
    0 0 18px rgba(245, 158, 11, 0.16);
}

.resource-card-artifact .resource-card-image {
  width: 58%;
  height: auto;
  max-height: 58%;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.resource-card-cost {
  position: absolute;
  z-index: 5;
  top: 5px;
  right: 5px;
  width: 30px;
  aspect-ratio: 1;
  pointer-events: none;
}

.resource-card-cost-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.resource-card-cost-value-fill,
.resource-card-cost-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', 'Outfit', sans-serif;
  font-size: 0.96rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums lining-nums;
  pointer-events: none;
}

.resource-card-cost-value-fill {
  color: rgba(255, 255, 255, 0.98);
  text-shadow:
    0 1px 0 rgba(255,255,255,0.98),
    1px 0 0 rgba(255,255,255,0.98),
    -1px 0 0 rgba(255,255,255,0.98),
    0 -1px 0 rgba(255,255,255,0.98);
}

.resource-card-cost-value {
  color: #111;
}

.resource-card-star-overlay {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(var(--card-name-panel-height) - 18px);
  display: none;
  transform: translateX(-50%);
}

.resource-card-name-panel {
  position: absolute;
  z-index: 3;
  inset-inline: 0;
  bottom: 0;
  height: var(--card-name-panel-height);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 8px 8px;
  color: #171717;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.96) 15%, rgba(255, 255, 255, 0.99) 100%);
  font-weight: 950;
  line-height: 1.16;
  text-align: center;
  pointer-events: none;
}

.resource-card-name-panel span {
  display: -webkit-box;
  overflow: hidden;
  max-width: 100%;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.resource-card-artifact .resource-card-star-overlay {
  display: inline-flex;
}

.resource-card-spell .resource-card-star-overlay {
  display: inline-flex;
}

.resource-solder-overlay {
  position: absolute;
  z-index: 5;
  right: 6px;
  bottom: calc(var(--card-name-panel-height) + 2px);
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: filter 140ms ease, opacity 140ms ease;
}

.resource-solder-overlay.is-disabled {
  cursor: default;
  filter: grayscale(0.9);
  opacity: 0.55;
}

@media (min-width: 701px) {
  .resource-solder-overlay.is-disabled {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
  }

  .resource-solder-overlay:not(.is-disabled):not(.has-solder) {
    filter: grayscale(0.55) saturate(0.65);
    opacity: 0.7;
  }

  .resource-solder-overlay.has-solder {
    filter: none;
    opacity: 1;
  }
}

.resource-solder-token-icon {
  width: 27px;
  height: 27px;
  display: block;
  object-fit: contain;
  filter:
    drop-shadow(0 0 0.4px rgba(255, 255, 255, 0.95))
    drop-shadow(0 1px 2px rgba(15, 23, 42, 0.28));
}

.resource-solder-token-value-fill,
.resource-solder-token-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', 'Outfit', sans-serif;
  font-size: 0.86rem;
  font-weight: 950;
  line-height: 1;
  pointer-events: none;
}

.resource-solder-token-value-fill {
  color: rgba(255, 255, 255, 0.98);
  text-shadow:
    0 1px 0 rgba(255,255,255,0.98),
    1px 0 0 rgba(255,255,255,0.98),
    -1px 0 0 rgba(255,255,255,0.98),
    0 -1px 0 rgba(255,255,255,0.98);
}

.resource-solder-token-value {
  color: #475569;
  text-shadow: 0 0 4px rgba(15, 23, 42, 0.18);
}

.resource-solder-overlay[data-card-solder-overlay]:not(.is-disabled) .resource-solder-token-value {
  color: #047857;
  text-shadow: 0 0 5px rgba(16, 185, 129, 0.35);
}

.resource-solder-overlay[data-card-solder-overlay]:not(.is-disabled) .resource-solder-token-value-fill {
  color: rgba(236, 253, 245, 1);
}

.resource-solder-overlay[data-card-solder-overlay][aria-label="はんだ+1"]:not(.is-disabled) .resource-solder-token-value {
  color: #3b82a0;
  text-shadow: 0 0 4px rgba(59, 130, 160, 0.22);
}

.resource-solder-overlay[data-card-solder-overlay][aria-label="はんだ+1"]:not(.is-disabled) .resource-solder-token-value-fill {
  color: rgba(224, 242, 254, 0.98);
}

.resource-solder-overlay[data-card-solder-overlay][aria-label="はんだ+2"]:not(.is-disabled) .resource-solder-token-value {
  color: #c026d3;
  text-shadow: none;
}

.resource-solder-overlay[data-card-solder-overlay][aria-label="はんだ+2"]:not(.is-disabled) .resource-solder-token-value-fill {
  color: rgba(255, 255, 255, 0.98);
}

.resource-solder-overlay[data-card-solder-overlay] .resource-solder-token-plus {
  font-size: 0.68em;
  transform: translate(-0.02em, -0.02em);
}

.resource-solder-overlay[data-card-solder-overlay] .resource-solder-token-number {
  font-size: 1.28em;
  transform: translateX(-0.02em);
}

.resource-effect-overlay {
  position: absolute;
  z-index: 5;
  left: 5px;
  top: 5px;
  min-width: 32px;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #f8fafc;
  background: linear-gradient(180deg, rgba(71, 85, 105, 0.92), rgba(51, 65, 85, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    0 5px 12px rgba(15, 23, 42, 0.24);
  font-size: 0.63rem;
  font-weight: 950;
  cursor: pointer;
}

.resource-effect-overlay.has-effect {
  border-color: rgba(96, 165, 250, 0.58);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.94), rgba(29, 78, 216, 0.94));
}

.resource-grade-picker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 6px;
  border: 1px solid rgba(190, 89, 112, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
}

.resource-card-star-overlay .resource-grade-picker {
  min-height: 28px;
  padding: 3px 6px;
  border-color: rgba(92, 52, 32, 0.18);
  background: rgba(255, 249, 225, 0.72);
  box-shadow: 0 2px 8px rgba(70, 40, 20, 0.2);
}

.resource-grade-btn {
  width: 23px;
  height: 23px;
  margin: 0 0 0 -3px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.resource-grade-btn:first-child {
  margin-left: 0;
}

.resource-grade-btn img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(112, 76, 32, 0.25));
}

.resource-effect-popover {
  position: fixed;
  z-index: 1800;
  width: min(310px, calc(100vw - 24px));
  padding: 0.75rem;
  border: 1px solid rgba(99, 102, 241, 0.24);
  border-radius: 14px;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.97);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.36);
}

.resource-effect-popover[hidden] {
  display: none !important;
}

.resource-effect-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.resource-effect-popover-head strong {
  min-width: 0;
  font-size: 0.86rem;
  line-height: 1.35;
}

.resource-effect-popover-head button {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.resource-effect-popover-body {
  display: grid;
  gap: 0.35rem;
}

.resource-effect-popover-body p {
  margin: 0;
  padding: 0.45rem 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(226, 232, 240, 0.92);
  font-size: 0.74rem;
  line-height: 1.45;
}

.aside-rank-icon {
  position: relative;
  background: rgba(255, 246, 208, 0.58);
}

.aside-rank-icon span {
  position: absolute;
  right: 3px;
  bottom: 3px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 1px 5px;
  color: #31553c;
  background: rgba(255, 253, 247, 0.92);
  font-size: 0.58rem;
  font-weight: 950;
  line-height: 1.1;
}

.formation-panel {
  overflow: visible;
}

.formation-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.formation-tools a,
.formation-tools button {
  min-height: 34px;
  border: 1px solid rgba(36, 83, 59, 0.18);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 34px;
  text-decoration: none;
  cursor: pointer;
}

.formation-save-panel {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
  padding: 8px;
  border: 1px solid rgba(36, 83, 59, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.64), rgba(236, 247, 229, 0.42));
}

.formation-save-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.formation-save-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.formation-save-fields {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(150px, 0.9fr);
  gap: 8px;
  align-items: end;
}

.formation-save-fields label {
  display: grid;
  gap: 3px;
  color: rgba(49, 85, 60, 0.72);
  font-size: 0.68rem;
  font-weight: 900;
}

.formation-save-editor {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(62, 129, 82, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(35, 52, 38, 0.12);
}

.formation-save-editor[hidden] {
  display: none;
}

.formation-save-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.formation-save-editor-actions button {
  min-height: 30px;
  border: 1px solid rgba(36, 83, 59, 0.18);
  border-radius: 999px;
  padding: 0 12px;
  color: #f8fff7;
  background: linear-gradient(135deg, #58a566, #34784b);
  font-size: 0.7rem;
  font-weight: 950;
  cursor: pointer;
}

.formation-save-editor-actions button:last-child {
  color: rgba(49, 85, 60, 0.78);
  background: rgba(255, 255, 255, 0.72);
}

.formation-tag-input {
  position: relative;
  display: block;
}

.formation-save-fields input {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(36, 83, 59, 0.16);
  border-radius: 12px;
  padding: 0 10px;
  color: #2a4633;
  background: rgba(255, 255, 255, 0.82);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  outline: none;
}

.formation-tag-input input {
  padding-right: 10px;
}

.formation-tag-presets {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  min-height: 32px;
  padding: 5px;
  border: 1px solid rgba(62, 129, 82, 0.16);
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 22px rgba(35, 52, 38, 0.12);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.formation-save-fields input:focus {
  border-color: rgba(80, 145, 91, 0.48);
  box-shadow: 0 0 0 3px rgba(114, 187, 121, 0.16);
}

.formation-tag-input:focus-within .formation-tag-presets {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.formation-tag-presets button {
  min-height: 22px;
  border: 1px solid rgba(62, 129, 82, 0.16);
  border-radius: 999px;
  padding: 0 7px;
  color: rgba(45, 83, 54, 0.86);
  background: rgba(223, 242, 219, 0.72);
  font-size: 0.6rem;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.formation-tag-presets button:hover {
  border-color: rgba(62, 129, 82, 0.34);
  background: rgba(211, 237, 205, 0.92);
}

.formation-save-actions button,
.formation-preset-actions button {
  min-height: 30px;
  border: 1px solid rgba(36, 83, 59, 0.18);
  border-radius: 999px;
  padding: 0 11px;
  color: #f8fff7;
  background: linear-gradient(135deg, #58a566, #34784b);
  font-size: 0.7rem;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(39, 93, 52, 0.14);
}

.formation-save-actions button:disabled {
  color: rgba(49, 85, 60, 0.45);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
  cursor: not-allowed;
}

.formation-active-preset {
  min-height: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 3px 8px;
  border: 0;
  border-radius: 999px;
  color: rgba(49, 85, 60, 0.58);
  background: rgba(255, 255, 255, 0.36);
  font-size: 0.68rem;
  font-weight: 900;
}

.formation-active-preset.is-active {
  color: #2e573a;
  background: rgba(224, 244, 220, 0.76);
}

.formation-active-preset.is-dirty {
  color: #7a4314;
  background: linear-gradient(135deg, rgba(255, 237, 213, 0.95), rgba(254, 215, 170, 0.78));
  box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.26);
}

.formation-active-preset strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #25462f;
  font-size: 0.76rem;
  font-weight: 950;
}

.formation-active-preset small {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.formation-active-preset b {
  border-radius: 999px;
  padding: 1px 6px;
  color: #36553e;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.58rem;
  font-weight: 950;
}

.formation-active-preset em {
  border-radius: 999px;
  padding: 1px 6px;
  color: #fff;
  background: rgba(234, 88, 12, 0.82);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 950;
}

.formation-save-actions button.is-dirty {
  color: #fff;
  background: linear-gradient(135deg, #f97316, #f59e0b);
  box-shadow: 0 5px 12px rgba(234, 88, 12, 0.22);
}

.formation-save-list {
  display: grid;
  gap: 6px;
}

.formation-save-empty {
  margin: 0;
  padding: 5px 2px 0;
  color: rgba(49, 85, 60, 0.58);
  font-size: 0.72rem;
  font-weight: 800;
}

.formation-preset-shortcuts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.formation-preset-shortcuts button {
  min-width: 0;
  min-height: 30px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(36, 83, 59, 0.16);
  border-radius: 10px;
  padding: 3px 6px;
  color: #294a32;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 4px 10px rgba(39, 93, 52, 0.08);
  cursor: pointer;
}

.formation-preset-shortcuts button span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: #f8fff7;
  background: linear-gradient(135deg, #62ad6f, #3b7f4f);
  font-size: 0.68rem;
  font-weight: 950;
}

.formation-preset-shortcuts button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.64rem;
  font-weight: 950;
  text-align: left;
}

.formation-preset-shortcuts button.is-selected {
  border-color: rgba(53, 139, 76, 0.46);
  background:
    linear-gradient(135deg, rgba(219, 246, 214, 0.96), rgba(188, 232, 184, 0.82));
  box-shadow:
    0 0 0 2px rgba(92, 168, 101, 0.16),
    0 6px 14px rgba(39, 93, 52, 0.12);
}

.formation-preset-shortcuts button.is-selected span {
  background: linear-gradient(135deg, #7fc36e, #2f8a4d);
}

.formation-preset-details {
  border: 1px solid rgba(36, 83, 59, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.34);
}

.formation-preset-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 0 9px;
  color: rgba(49, 85, 60, 0.82);
  font-size: 0.74rem;
  font-weight: 950;
  cursor: pointer;
  list-style: none;
}

.formation-preset-details summary::-webkit-details-marker {
  display: none;
}

.formation-preset-details summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  color: #f8fff7;
  background: rgba(66, 130, 79, 0.8);
  font-weight: 950;
}

.formation-preset-details[open] summary::after {
  content: "-";
}

.formation-preset-details summary span {
  margin-left: auto;
  margin-right: 8px;
  color: rgba(49, 85, 60, 0.58);
  font-size: 0.66rem;
}

.formation-preset-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 7px;
  padding: 0 8px 8px;
}

.formation-preset-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(36, 83, 59, 0.11);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.formation-preset-card.is-selected {
  border-color: rgba(53, 139, 76, 0.32);
  background: rgba(228, 247, 224, 0.78);
  box-shadow: inset 0 0 0 1px rgba(92, 168, 101, 0.12);
}

.formation-preset-card > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.formation-preset-card strong,
.formation-preset-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formation-preset-card strong {
  color: #294a32;
  font-size: 0.78rem;
  font-weight: 950;
}

.formation-preset-card span {
  color: rgba(49, 85, 60, 0.72);
  font-size: 0.66rem;
  font-weight: 850;
}

.formation-preset-card small {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.formation-preset-card b {
  border-radius: 999px;
  padding: 1px 6px;
  color: #36553e;
  background: rgba(203, 235, 202, 0.72);
  font-size: 0.58rem;
  font-weight: 950;
}

.formation-preset-actions {
  display: flex;
  gap: 5px;
}

.formation-preset-actions button {
  min-height: 28px;
  border-radius: 10px;
  padding: 0 8px;
  font-size: 0.66rem;
}

.formation-preset-actions button.favorite {
  width: 28px;
  padding: 0;
  color: #7b6a24;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: none;
}

.formation-preset-actions button.favorite.is-on {
  color: #fff8d0;
  border-color: rgba(222, 171, 42, 0.46);
  background: linear-gradient(135deg, #f0c34c, #c78d21);
  box-shadow: 0 4px 10px rgba(177, 121, 26, 0.18);
}

.formation-preset-slot-picker {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding-top: 2px;
}

.formation-preset-slot-picker button {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(36, 83, 59, 0.14);
  border-radius: 999px;
  padding: 0;
  color: rgba(49, 85, 60, 0.78);
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.66rem;
  font-weight: 950;
  cursor: pointer;
}

.formation-preset-slot-picker button.is-selected {
  color: #fff8d0;
  border-color: rgba(222, 171, 42, 0.46);
  background: linear-gradient(135deg, #f0c34c, #c78d21);
  box-shadow: 0 4px 10px rgba(177, 121, 26, 0.18);
}

.formation-preset-actions button.danger {
  border-color: rgba(190, 74, 72, 0.18);
  background: linear-gradient(135deg, #df837d, #b6534d);
  box-shadow: 0 5px 12px rgba(148, 54, 48, 0.12);
}

.formation-cost-summary {
  position: sticky;
  top: 78px;
  z-index: 24;
  width: 100%;
  min-height: 32px;
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  grid-column: 1;
  grid-row: 2;
  justify-self: stretch;
  margin-top: -2px;
}
.formation-coin-box {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
  padding: 5px 7px;
  border: 1px solid rgba(155, 114, 43, 0.18);
  border-radius: 14px;
  background: rgba(255, 248, 220, 0.72);
}

.formation-coin-owned,
.formation-coin-remain,
.formation-total-cost {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #7c541d;
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.formation-coin-owned {
  position: relative;
  gap: 1px;
}

.formation-coin-owned em {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  border-radius: 999px;
  padding: 1px 4px;
  color: #0f6f52;
  background: rgba(62, 180, 137, 0.18);
  font-style: normal;
  font-size: 0.56rem;
  font-weight: 1000;
}

.formation-coin-input-wrap {
  position: relative;
  border: 0;
  padding: 0;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.formation-coin-input-wrap img {
  grid-area: 1 / 1;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.formation-coin-display {
  grid-area: 1 / 1;
  position: relative;
  z-index: 2;
  transform: translateY(1px) scaleX(0.92);
  max-width: 3.2em;
  overflow: hidden;
  pointer-events: none;
  text-align: center;
}

.formation-coin-popover {
  position: absolute;
  z-index: 32;
  top: calc(100% + 7px);
  left: 50%;
  display: grid;
  min-width: 9.5rem;
  transform: translateX(-50%);
  gap: 0.42rem;
  border: 1px solid rgba(155, 114, 43, 0.24);
  border-radius: 14px;
  padding: 0.55rem;
  background: rgba(255, 252, 238, 0.98);
  box-shadow: 0 14px 28px rgba(99, 69, 20, 0.18);
}

.formation-coin-popover[hidden] {
  display: none;
}

.formation-coin-popover label {
  display: grid;
  gap: 0.28rem;
  color: #7c541d;
  font-size: 0.68rem;
  font-weight: 950;
}

.formation-coin-popover input {
  width: 100%;
  min-height: 2.1rem;
  border: 1px solid rgba(155, 114, 43, 0.24);
  border-radius: 10px;
  padding: 0 0.55rem;
  color: #35230e;
  background: #fff;
  font-family: 'Baloo 2', 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 950;
  text-align: center;
}

.formation-coin-popover button {
  min-height: 1.85rem;
  border: 1px solid rgba(155, 114, 43, 0.2);
  border-radius: 999px;
  color: #7c541d;
  background: rgba(255, 245, 205, 0.92);
  font-size: 0.72rem;
  font-weight: 950;
  cursor: pointer;
}

.formation-coin-auto-note {
  display: block;
  border-radius: 10px;
  padding: 0.32rem 0.42rem;
  color: #6f4612;
  background: rgba(255, 239, 184, 0.62);
  font-size: 0.66rem;
  font-weight: 950;
  text-align: center;
}

.formation-coin-display,
.formation-cost-text,
.formation-metric-number {
  font-family: 'Baloo 2', 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.02em;
}

.formation-coin-owned .formation-coin-display,
.formation-total-cost .formation-cost-text,
.formation-coin-remain .formation-metric-number {
  font-size: 0.92rem;
  font-weight: 950;
  line-height: 1;
}

.formation-metric-number {
  position: relative;
  display: inline-grid;
  width: 30px;
  height: 30px;
  min-width: 1.35em;
  place-items: center;
  transform: translateY(1px) scaleX(0.92);
}

.formation-metric-number-stroke,
.formation-metric-number-fill {
  grid-area: 1 / 1;
  font: inherit;
  line-height: inherit;
}

.formation-coin-display-stroke {
  z-index: 2;
  color: #fff;
  -webkit-text-stroke: 3px #fff;
}

.formation-metric-number-stroke {
  z-index: 1;
  color: #fff;
  -webkit-text-stroke: 3px #fff;
}

.formation-coin-display-fill {
  z-index: 3;
  color: #111;
}

.formation-metric-number-fill {
  z-index: 2;
  color: #111;
}

.formation-metric-number.is-negative .formation-metric-number-fill {
  color: #c2410c;
}

.formation-total-cost .formation-cost-badge {
  position: relative;
  right: auto;
  bottom: auto;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  font-size: 0.9rem;
}

.formation-member-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  color: #41624c;
  font-size: 0.68rem;
  font-weight: 900;
}

.formation-member-count {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 2px 8px;
  border: 1px solid rgba(36, 83, 59, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.formation-member-count-cost {
  min-height: 30px;
  flex: 0 0 auto;
  align-items: center;
  align-self: center;
}
.formation-member-count strong {
  color: #1f5134;
  font-size: 0.82rem;
}

.formation-combat-power {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(172, 120, 30, 0.2);
  border-radius: 12px;
  padding: 3px 8px 3px 5px;
  color: #70480f;
  background: linear-gradient(135deg, rgba(255, 242, 190, 0.72), rgba(245, 229, 190, 0.5));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.formation-combat-power img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.formation-combat-power > span {
  display: grid;
  gap: 1px;
  line-height: 1;
  text-align: right;
}

.formation-combat-power small {
  color: rgba(112, 72, 15, 0.68);
  font-size: 0.56rem;
  font-weight: 900;
}

.formation-combat-power strong {
  color: #6b4309;
  font-family: 'Baloo 2', 'Outfit', sans-serif;
  font-size: 0.86rem;
  font-weight: 1000;
  letter-spacing: -0.02em;
}

.formation-combat-power-total {
  border-color: rgba(64, 114, 142, 0.18);
  color: #315d73;
  background: linear-gradient(135deg, rgba(213, 232, 238, 0.74), rgba(219, 229, 222, 0.58));
}

.formation-combat-power-total small {
  color: rgba(49, 93, 115, 0.68);
}

.formation-combat-power-total strong {
  color: #274f63;
}

.formation-synergy-popover-body p {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem;
}

.formation-synergy-popover-body b {
  color: #f8fafc;
  white-space: nowrap;
}

.formation-synergy-popover-body span {
  color: rgba(226, 232, 240, 0.94);
}

.formation-synergy-popover-body p:first-child {
  border-color: rgba(125, 211, 252, 0.24);
  background: rgba(14, 165, 233, 0.12);
}

.formation-synergy-popover {
  background: rgba(15, 23, 42, 0.84);
  backdrop-filter: blur(5px);
}

.formation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto auto;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
}

.formation-overview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.formation-overview-side {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.formation-synergy-summary {
  display: grid;
  justify-items: start;
  gap: 5px;
  min-width: 0;
}

.formation-synergy-summary:focus-visible {
  outline: 2px solid rgba(52, 137, 91, 0.45);
  outline-offset: 3px;
  border-radius: 16px;
}

[data-formation-synergy-kind]:focus-visible {
  outline: 2px solid rgba(52, 137, 91, 0.45);
  outline-offset: 3px;
  border-radius: 16px;
}

[data-formation-synergy-kind] {
  cursor: pointer;
}

.formation-synergy-group {
  display: grid;
  align-items: center;
}

.formation-synergy-personality {
  width: fit-content;
  max-width: 100%;
  justify-self: start;
  border: 0;
  border-radius: 18px;
  padding: 7px 10px;
  background: transparent;
}

.formation-synergy-race {
  justify-self: start;
  padding-left: 6px;
}

.formation-synergy-slot-grid {
  display: grid;
  grid-template-rows: repeat(2, 1.34rem);
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  gap: 0.08rem 0.02rem;
  min-height: 2.72rem;
}

.formation-synergy-slot-grid-personality {
  grid-template-columns: repeat(15, 0.64rem);
}

.formation-synergy-slot {
  position: relative;
  width: 1.22rem;
  height: 1.22rem;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 1px dashed rgba(74, 103, 82, 0.16);
  border-radius: 50%;
  background: transparent;
}

.formation-synergy-slot[data-row="top"] {
  grid-row: 1;
}

.formation-synergy-slot[data-row="bottom"] {
  grid-row: 2;
}

.formation-synergy-slot.is-filled {
  border-color: transparent;
  background: transparent;
  filter: drop-shadow(0 2px 3px rgba(39, 57, 42, 0.2));
}

.formation-synergy-slot.is-filled.is-redundant {
  opacity: 0.42;
  filter: grayscale(0.18) saturate(0.68) drop-shadow(0 1px 1px rgba(39, 57, 42, 0.1));
}

.formation-synergy-slot-icon {
  width: 1.28rem;
  height: 1.28rem;
  object-fit: contain;
  background: transparent !important;
  box-shadow: none !important;
}

.formation-synergy-extra {
  position: absolute;
  right: -0.25rem;
  bottom: -0.14rem;
  min-width: 0.72rem;
  height: 0.72rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  color: #fff;
  background: rgba(222, 139, 36, 0.95);
  box-shadow: 0 1px 4px rgba(39, 57, 42, 0.22);
  font-size: 0.58rem;
  font-weight: 950;
  line-height: 1;
}

.formation-race-synergy-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  justify-content: center;
  gap: 5px;
  min-width: 42px;
}

.formation-race-synergy-list.is-empty {
  min-height: 1px;
}

.formation-race-synergy-item {
  position: relative;
  display: grid;
  grid-template-columns: 1.28rem auto;
  align-items: center;
  gap: 2px;
  min-height: 1.46rem;
  padding: 1px 5px 1px 3px;
  border: 1px solid rgba(36, 83, 59, 0.08);
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.formation-race-synergy-item img {
  width: 1.24rem;
  height: 1.24rem;
  object-fit: contain;
  background: transparent !important;
  box-shadow: none !important;
}

.formation-race-count {
  min-width: 1.25rem;
  color: #31553c;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
}

.formation-race-extra {
  position: absolute;
  right: -0.18rem;
  top: -0.2rem;
  min-width: 0.78rem;
  height: 0.78rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  color: #fff;
  background: rgba(222, 139, 36, 0.95);
  box-shadow: 0 1px 4px rgba(39, 57, 42, 0.22);
  font-size: 0.52rem;
  font-weight: 950;
  line-height: 1;
}

@media (max-width: 520px) {
  .formation-layout {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .formation-board {
    width: calc(100% + 22px);
    max-width: calc(100% + 22px);
    margin-right: -11px;
    margin-left: -11px;
  }

  .formation-overview-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .formation-overview-side,
  .formation-member-summary {
    width: 100%;
    min-width: 0;
  }

  .formation-overview-side {
    justify-items: stretch;
  }

  .formation-member-summary {
    justify-content: flex-start;
  }

  .formation-artifact-list {
    grid-template-columns: repeat(3, 27px);
    gap: 1px;
    justify-content: center;
  }

  .formation-artifact-slot {
    width: 27px;
    height: 27px;
  }

  .formation-artifact-slot.is-favorite-equipped::before,
  .formation-artifact-slot.is-favorite-equipped::after {
    inset: -2px;
  }

  .formation-artifact-slot .formation-cost-badge {
    right: -2px;
    bottom: -3px;
    width: 22px;
    height: 22px;
  }

  .formation-synergy-personality,
  .formation-synergy-race,
  .formation-board {
    grid-column: 1;
  }

  .formation-synergy-personality {
    justify-self: start;
    padding-inline: 9px;
  }

  .formation-synergy-race {
    justify-self: start;
  }

  .formation-board {
    grid-row: 3;
  }

  .formation-race-synergy-list {
    gap: 5px;
  }

  .formation-synergy-slot-grid {
    grid-template-rows: repeat(2, 1.22rem);
    min-height: 2.48rem;
  }

  .formation-synergy-slot-grid-personality {
    grid-template-columns: repeat(15, 0.56rem);
  }

  .formation-synergy-slot {
    width: 1.17rem;
    height: 1.17rem;
  }

  .formation-synergy-slot-icon {
    width: 1.22rem;
    height: 1.22rem;
  }
}

.formation-board {
  grid-column: 1;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(226px, 310px));
  gap: clamp(0px, 0.8vw, 8px);
  align-items: center;
  justify-content: center;
  overflow-x: auto;
  padding: 22px 8px 26px;
}

.formation-column {
  --formation-panel-border: rgba(255, 255, 255, 0.22);
  --formation-panel-bg-a: rgba(255, 255, 255, 0.2);
  --formation-panel-bg-b: rgba(255, 255, 255, 0.1);
  --formation-notch: 22px;
  --formation-border-size: 2px;
  position: relative;
  min-width: 226px;
  width: clamp(226px, 27vw, 310px);
  display: grid;
  gap: 10px;
  border: 0;
  border-radius: 0;
  padding: 14px 20px 14px 24px;
  isolation: isolate;
}

.formation-column::before,
.formation-column::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, calc(100% - var(--formation-notch)) 0, 100% 50%, calc(100% - var(--formation-notch)) 100%, 0 100%, var(--formation-notch) 50%);
  pointer-events: none;
}

.formation-column::before {
  z-index: -2;
  background: var(--formation-panel-border);
  filter: drop-shadow(0 10px 20px rgba(40, 48, 38, 0.08));
}

.formation-column::after {
  z-index: -1;
  inset: var(--formation-border-size);
  background:
    linear-gradient(135deg, var(--formation-panel-bg-a), var(--formation-panel-bg-b)),
    rgba(255, 255, 255, 0.16);
  clip-path: polygon(0 0, calc(100% - var(--formation-notch)) 0, 100% 50%, calc(100% - var(--formation-notch)) 100%, 0 100%, var(--formation-notch) 50%);
}

.formation-column-1 {
  --formation-panel-border: rgba(67, 150, 222, 0.5);
  --formation-panel-bg-a: rgba(75, 160, 232, 0.34);
  --formation-panel-bg-b: rgba(37, 108, 184, 0.2);
  --formation-line-color: rgba(82, 168, 235, 0.38);
  transform: translateX(10px);
}

.formation-column-2 {
  --formation-panel-border: rgba(111, 190, 63, 0.52);
  --formation-panel-bg-a: rgba(122, 204, 74, 0.34);
  --formation-panel-bg-b: rgba(74, 154, 50, 0.2);
  --formation-line-color: rgba(129, 210, 78, 0.38);
}

.formation-column-3 {
  --formation-panel-border: rgba(224, 76, 73, 0.52);
  --formation-panel-bg-a: rgba(232, 76, 73, 0.34);
  --formation-panel-bg-b: rgba(176, 56, 58, 0.2);
  --formation-line-color: rgba(238, 91, 88, 0.38);
  transform: translateX(-10px);
}

.formation-column-head {
  position: absolute;
  z-index: 2;
  right: 16px;
  top: -14px;
  min-height: 0;
}

.formation-column-head button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  padding: 0;
  color: rgba(39, 57, 42, 0.72);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
  line-height: 0;
  box-shadow: 0 4px 10px rgba(35, 45, 35, 0.12);
  cursor: pointer;
}

.formation-column-head button .ui-icon {
  width: 1rem;
  height: 1rem;
}

.formation-line {
  position: relative;
  display: grid;
  grid-template-columns: clamp(64px, 7vw, 80px) minmax(0, 1fr);
  gap: clamp(5px, 0.8vw, 10px);
  align-items: center;
  padding: 10px 0;
}

.formation-line + .formation-line::before {
  content: "";
  position: absolute;
  left: clamp(6px, 4%, 14px);
  right: clamp(12px, 8%, 24px);
  top: -5px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--formation-line-color, rgba(255, 255, 255, 0.36)) 14%, var(--formation-line-color, rgba(255, 255, 255, 0.36)) 82%, transparent);
  opacity: 0.78;
  pointer-events: none;
}

.formation-line:nth-of-type(3) {
  transform: translateX(14px);
}

.formation-line:first-of-type {
  border-top: 0;
}

.formation-apostle-slot,
.formation-artifact-slot {
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.formation-apostle-slot {
  --formation-personality-color: var(--green);
  width: clamp(64px, 7vw, 78px);
  height: clamp(64px, 7vw, 78px);
  border-radius: 19px;
  overflow: hidden;
}

@media (pointer: coarse) {
  .formation-apostle-slot {
    touch-action: none;
  }
}

.formation-apostle-slot.is-filled {
  border: 2px solid color-mix(in srgb, var(--formation-personality-color) 62%, white);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--formation-personality-color) 38%, white),
      color-mix(in srgb, var(--formation-personality-color) 18%, white));
  overflow: visible;
  box-shadow: 0 5px 12px rgba(34, 45, 36, 0.12);
}

.formation-apostle-slot.is-filled::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: 17px;
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.5), transparent 58%),
    rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.formation-board.is-dragging-apostle .formation-apostle-slot {
  cursor: grabbing;
}

.formation-apostle-slot.is-dragging {
  opacity: 0.46;
  transform: scale(0.96);
}

.formation-apostle-slot.is-drop-compatible {
  outline: 2px dashed color-mix(in srgb, var(--formation-personality-color, var(--green)) 72%, white);
  outline-offset: 3px;
}

.formation-apostle-slot.is-drop-target {
  outline-style: solid;
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--formation-personality-color, var(--green)) 28%, transparent),
    0 8px 18px rgba(34, 45, 36, 0.18);
  transform: translateY(-1px) scale(1.03);
}

.formation-apostle-slot.personality-純粋 { --formation-personality-color: var(--personality-pure); }
.formation-apostle-slot.personality-冷静 { --formation-personality-color: var(--personality-calm); }
.formation-apostle-slot.personality-狂気 { --formation-personality-color: var(--personality-madness); }
.formation-apostle-slot.personality-活発 { --formation-personality-color: var(--personality-active); }
.formation-apostle-slot.personality-憂鬱 { --formation-personality-color: var(--personality-gloomy); }

.formation-artifact-list {
  display: grid;
  grid-template-columns: repeat(3, clamp(34px, 4.4vw, 54px));
  justify-content: start;
  gap: clamp(2px, 0.35vw, 5px);
  align-items: center;
}

.formation-artifact-slot {
  --formation-artifact-color: rgba(140, 150, 130, 0.34);
  --formation-artifact-glow: rgba(42, 55, 38, 0.12);
  width: clamp(34px, 4.4vw, 54px);
  height: clamp(34px, 4.4vw, 54px);
  justify-self: center;
}

.formation-artifact-slot.rarity-signature {
  --formation-artifact-color: rgba(168, 85, 247, 0.46);
  --formation-artifact-glow: rgba(126, 34, 206, 0.18);
}

.formation-artifact-slot.rarity-legendary {
  --formation-artifact-color: rgba(168, 85, 247, 0.46);
  --formation-artifact-glow: rgba(126, 34, 206, 0.18);
}

.formation-artifact-slot.rarity-unique {
  --formation-artifact-color: rgba(59, 130, 246, 0.42);
  --formation-artifact-glow: rgba(37, 99, 235, 0.16);
}

.formation-artifact-slot.rarity-rare {
  --formation-artifact-color: rgba(34, 197, 94, 0.4);
  --formation-artifact-glow: rgba(22, 163, 74, 0.14);
}

.formation-artifact-slot.is-favorite-equipped::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -3px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%,
      rgba(255, 247, 196, 0.98) 0 54%,
      rgba(250, 204, 21, 0.86) 55% 74%,
      rgba(217, 119, 6, 0.58) 75% 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.7),
    0 4px 12px rgba(234, 179, 8, 0.32);
  pointer-events: none;
}

.formation-artifact-slot.is-favorite-equipped::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: -3px;
  border: 2px solid rgba(245, 158, 11, 0.96);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.58),
    0 0 10px rgba(234, 179, 8, 0.32);
  pointer-events: none;
}

.formation-spell-list {
  grid-column: 1;
  grid-row: 4;
  width: min(100%, 920px);
  justify-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  justify-content: stretch;
  gap: 10px;
  margin-top: -6px;
  padding: 9px 12px;
  border: 1px solid rgba(36, 83, 59, 0.11);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
}

.formation-spell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #31553c;
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.formation-spell-head small {
  color: rgba(49, 85, 60, 0.7);
  font-size: 0.68rem;
  letter-spacing: 0;
}

.formation-spell-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.formation-spell-detail-toggle {
  border: 1px solid rgba(49, 85, 60, 0.22);
  border-radius: 999px;
  padding: 4px 10px;
  color: #28533a;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0;
  cursor: pointer;
}

.formation-spell-detail-toggle:disabled {
  opacity: 0.45;
  cursor: default;
}

.formation-spell-detail-toggle:not(:disabled):hover {
  background: rgba(232, 246, 229, 0.9);
}

.formation-spell-selected,
.formation-spell-catalog {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.formation-spell-selected {
  min-height: 50px;
  align-items: center;
  padding: 3px 4px;
}

.formation-spell-selected-effect-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.36);
}

.formation-spell-selected-effect-summary > span {
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 999px;
  padding: 2px 7px;
  color: #fff;
  background: rgba(38, 54, 44, 0.78);
  font-size: 0.6rem;
  font-weight: 950;
  line-height: 1.25;
  white-space: nowrap;
}

.formation-spell-selected-effect-summary > .formation-spell-selected-effect-title {
  border-color: rgba(49, 85, 60, 0.18);
  color: rgba(42, 72, 51, 0.82);
  background: rgba(255, 255, 255, 0.72);
}

.formation-spell-selected-effect-summary > .is-hp { background: rgba(24, 105, 55, 0.88); }
.formation-spell-selected-effect-summary > .is-recovery { color: #f1ffd9; background: rgba(76, 119, 31, 0.9); }
.formation-spell-selected-effect-summary > .is-attack { background: rgba(137, 39, 42, 0.9); }
.formation-spell-selected-effect-summary > .is-attack-speed { background: rgba(151, 77, 19, 0.9); }
.formation-spell-selected-effect-summary > .is-defense { background: rgba(31, 77, 139, 0.9); }
.formation-spell-selected-effect-summary > .is-crit { color: #fffbd8; background: rgba(126, 97, 10, 0.92); }
.formation-spell-selected-effect-summary > .is-crit-resist { background: rgba(91, 44, 137, 0.92); }

:root[data-theme="dark"] .formation-spell-selected-effect-summary {
  background: rgba(15, 23, 42, 0.62);
}

:root[data-theme="dark"] .formation-spell-selected-effect-summary > .formation-spell-selected-effect-title {
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(226, 232, 240, 0.84);
  background: rgba(30, 41, 59, 0.9);
}

.formation-spell-detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 7px;
  padding: 7px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.36);
}

.formation-spell-detail-card {
  --formation-spell-color: rgba(140, 150, 130, 0.34);
  display: grid;
  gap: 5px;
  border: 1px solid color-mix(in srgb, var(--formation-spell-color) 66%, white);
  border-radius: 12px;
  padding: 7px;
  background: color-mix(in srgb, var(--formation-spell-color) 14%, rgba(255, 255, 255, 0.86));
}

.formation-spell-detail-title {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: #24452f;
  font-size: 0.72rem;
  font-weight: 950;
}

.formation-spell-detail-title img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
}

.formation-spell-detail-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formation-spell-detail-title span {
  border-radius: 999px;
  padding: 2px 6px;
  color: #2b4a36;
  background: rgba(255, 255, 255, 0.68);
  font-size: 0.66rem;
}

.formation-spell-detail-body {
  display: grid;
  gap: 3px;
}

.formation-spell-detail-body p {
  margin: 0;
  color: rgba(34, 65, 45, 0.82);
  font-size: 0.68rem;
  line-height: 1.35;
}

.formation-spell-summary-popover {
  width: min(640px, calc(100vw - 24px));
  max-height: min(68vh, 620px);
  animation: formation-spell-popover-in 140ms ease-out;
  transform-origin: top right;
}

.formation-spell-summary-popover-body {
  max-height: min(60vh, 540px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.formation-spell-summary-popover .formation-spell-detail-list {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  padding: 0;
  background: transparent;
}

@keyframes formation-spell-popover-in {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.formation-spell-catalog {
  justify-content: flex-start;
  max-height: 420px;
  overflow-y: auto;
  padding: 7px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.4);
}

.formation-spell-empty {
  grid-column: 1 / -1;
  color: rgba(49, 85, 60, 0.66);
  font-size: 0.74rem;
  font-weight: 800;
}

.formation-spell-card,
.formation-spell-selected-card {
  --formation-spell-color: rgba(140, 150, 130, 0.34);
  --formation-spell-glow: rgba(42, 55, 38, 0.12);
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--formation-spell-color) 72%, white);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 5px 10px var(--formation-spell-glow);
  cursor: pointer;
}

.formation-spell-card {
  width: 84px;
  min-height: 120px;
  grid-template-rows: 64px 28px 20px;
  gap: 3px;
  padding: 3px;
  align-content: start;
}

.formation-spell-card.is-selected {
  transform: translateY(-1px);
  box-shadow:
    0 5px 10px var(--formation-spell-glow),
    0 0 0 2px rgba(52, 211, 153, 0.38);
}

.formation-spell-selected-card {
  width: 48px;
  aspect-ratio: 5 / 6;
  border-radius: 12px;
}

.formation-spell-selected-card .formation-spell-img {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
}

.formation-spell-count {
  position: absolute;
  right: 2px;
  top: 2px;
  min-width: 20px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  padding: 1px 5px;
  color: #fff;
  background: rgba(36, 83, 59, 0.86);
  font-size: 0.62rem;
  font-weight: 950;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.24);
}

.formation-spell-card-art {
  position: relative;
  width: 100%;
  height: 64px;
  display: block;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--formation-spell-color) 46%, white);
  border-radius: 10px;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--formation-spell-color) 20%, white),
      rgba(255, 255, 255, 0.72));
}

.formation-spell-card-effects {
  position: absolute;
  z-index: 3;
  top: 2px;
  left: 2px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  pointer-events: auto;
}

.formation-spell-info-btn {
  position: absolute;
  z-index: 4;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  padding: 0;
  color: #fff;
  background: rgba(20, 34, 54, 0.78);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  font-family: Georgia, serif;
  font-size: 0.65rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  cursor: pointer;
}

.formation-spell-info-btn:hover,
.formation-spell-info-btn:focus-visible {
  border-color: #fff;
  background: rgba(38, 77, 119, 0.94);
  transform: scale(1.08);
}

:root[data-theme="dark"] body.dashboard-page .formation-spell-info-btn {
  opacity: 1;
  background-color: #142236 !important;
  background-image: none !important;
}

:root[data-theme="dark"] body.dashboard-page .formation-spell-info-btn:hover,
:root[data-theme="dark"] body.dashboard-page .formation-spell-info-btn:focus-visible,
:root[data-theme="dark"] body.dashboard-page .formation-picker-effect-btn:hover,
:root[data-theme="dark"] body.dashboard-page .formation-picker-effect-btn:focus-visible {
  opacity: 1 !important;
  background-color: #264d77 !important;
  background-image: none !important;
}

.formation-spell-card-effects > span {
  display: block;
  overflow: hidden;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  padding: 1px 4px;
  color: #fff;
  background: rgba(8, 15, 28, 0.74);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.34);
  font-size: 0.48rem;
  font-weight: 950;
  line-height: 1.12;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
  white-space: nowrap;
}

.formation-spell-card-effects > .is-hp {
  border-color: rgba(107, 218, 137, 0.72);
  background: rgba(24, 105, 55, 0.82);
}

.formation-spell-card-effects > .is-recovery {
  border-color: rgba(184, 235, 113, 0.76);
  color: #f1ffd9;
  background: rgba(76, 119, 31, 0.84);
}

.formation-spell-card-effects > .is-attack {
  border-color: rgba(255, 124, 124, 0.76);
  background: rgba(137, 39, 42, 0.84);
}

.formation-spell-card-effects > .is-attack-speed {
  border-color: rgba(255, 177, 91, 0.8);
  background: rgba(151, 77, 19, 0.84);
}

.formation-spell-card-effects > .is-defense {
  border-color: rgba(117, 177, 255, 0.78);
  background: rgba(31, 77, 139, 0.84);
}

.formation-spell-card-effects > .is-crit {
  border-color: rgba(255, 224, 98, 0.84);
  color: #fffbd8;
  background: rgba(126, 97, 10, 0.86);
}

.formation-spell-card-effects > .is-crit-resist {
  border-color: rgba(198, 139, 255, 0.8);
  background: rgba(91, 44, 137, 0.86);
}

.formation-spell-card-art .formation-spell-img {
  width: 108%;
  height: 108%;
  margin: -4%;
  border-radius: 0;
  object-fit: cover;
}

.formation-spell-card-art .formation-cost-badge {
  right: 1px;
  bottom: 1px;
  width: 24px;
  height: 24px;
}

.formation-spell-card.rarity-signature,
.formation-spell-selected-card.rarity-signature,
.formation-spell-detail-card.rarity-signature {
  --formation-spell-color: rgba(251, 191, 36, 0.74);
  --formation-spell-glow: rgba(245, 158, 11, 0.18);
}

.formation-spell-card.rarity-legendary,
.formation-spell-selected-card.rarity-legendary,
.formation-spell-detail-card.rarity-legendary {
  --formation-spell-color: rgba(168, 85, 247, 0.62);
  --formation-spell-glow: rgba(126, 34, 206, 0.18);
}

.formation-spell-card.rarity-unique,
.formation-spell-selected-card.rarity-unique,
.formation-spell-detail-card.rarity-unique {
  --formation-spell-color: rgba(59, 130, 246, 0.58);
  --formation-spell-glow: rgba(37, 99, 235, 0.16);
}

.formation-spell-card.rarity-rare,
.formation-spell-selected-card.rarity-rare,
.formation-spell-detail-card.rarity-rare {
  --formation-spell-color: rgba(34, 197, 94, 0.54);
  --formation-spell-glow: rgba(22, 163, 74, 0.14);
}

.formation-spell-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.formation-spell-name {
  width: 100%;
  align-self: center;
  display: -webkit-box;
  overflow: hidden;
  max-height: 2.12em;
  color: #273f2f;
  font-size: 0.6rem;
  font-weight: 900;
  line-height: 1.06;
  text-align: center;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.formation-spell-qty {
  width: 100%;
  display: grid;
  grid-template-columns: 19px 1fr 19px;
  align-items: center;
  gap: 1px;
  padding: 1px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(36, 83, 59, 0.12);
}

.formation-spell-qty-btn {
  width: 19px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #64b279, #3c8f58);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 0;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(36, 83, 59, 0.2);
}

.formation-master-power {
  grid-column: 1;
  grid-row: 5;
  width: min(100%, 920px);
  box-sizing: border-box;
  justify-self: center;
  display: grid;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(83, 65, 133, 0.16);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(247, 244, 255, 0.78), rgba(255, 255, 255, 0.5));
}

.formation-master-power-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #51436f;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.06em;
}

.formation-master-power-head small {
  color: rgba(81, 67, 111, 0.72);
  font-size: 0.68rem;
  letter-spacing: 0;
}

.formation-master-power-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.formation-master-power-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(2.05em, auto) auto;
  align-content: start;
  gap: 5px;
  border: 1px solid rgba(91, 71, 138, 0.18);
  border-radius: 13px;
  padding: 5px;
  color: #44375f;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 10px rgba(62, 45, 99, 0.08);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.formation-master-power-card:hover,
.formation-master-power-card:focus-visible {
  border-color: rgba(111, 75, 190, 0.48);
  background: rgba(250, 247, 255, 0.96);
  box-shadow: 0 7px 15px rgba(74, 47, 132, 0.15);
  transform: translateY(-1px);
}

.formation-master-power-card.is-selected {
  border-color: rgba(119, 76, 210, 0.86);
  background: linear-gradient(145deg, rgba(240, 232, 255, 0.98), rgba(255, 255, 255, 0.94));
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.18), 0 8px 17px rgba(85, 48, 159, 0.18);
}

.formation-master-power-media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 9px;
  background: rgba(38, 28, 59, 0.82);
}

.formation-master-power-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.formation-master-power-media .formation-cost-badge {
  right: 3px;
  bottom: 3px;
  width: 24px;
  height: 24px;
}

.formation-master-power-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: #fff;
  background: rgba(112, 68, 207, 0.94);
  box-shadow: 0 2px 7px rgba(35, 20, 67, 0.3);
  font-size: 0.72rem;
  font-weight: 1000;
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 120ms ease, transform 120ms ease;
}

.formation-master-power-card.is-selected .formation-master-power-check {
  opacity: 1;
  transform: scale(1);
}

.formation-master-power-card > strong {
  align-self: center;
  overflow: hidden;
  color: inherit;
  font-size: 0.7rem;
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
}

.formation-master-power-card > small {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 6px;
  color: rgba(68, 55, 95, 0.72);
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1.1;
}

.formation-master-power-detail {
  min-height: 42px;
  display: grid;
  gap: 5px;
  border-radius: 12px;
  padding: 7px 9px;
  color: rgba(68, 55, 95, 0.72);
  background: rgba(255, 255, 255, 0.42);
  font-size: 0.68rem;
}

.formation-master-power-detail > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.formation-master-power-detail > div:first-child strong {
  color: #493769;
  font-size: 0.75rem;
  font-weight: 950;
}

.formation-master-power-detail > div:first-child span {
  color: rgba(73, 55, 105, 0.64);
  font-size: 0.62rem;
  font-weight: 900;
}

.formation-master-power-detail p {
  margin: 0;
  line-height: 1.4;
}

.formation-master-power-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.formation-master-power-effects span {
  border: 1px solid rgba(113, 82, 167, 0.14);
  border-radius: 999px;
  padding: 2px 7px;
  color: #574172;
  background: rgba(241, 234, 255, 0.76);
  font-size: 0.61rem;
  font-weight: 900;
}

@media (max-width: 720px) {
  .formation-master-power-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.formation-spell-qty-btn .ui-icon {
  width: 0.72rem;
  height: 0.72rem;
  stroke-width: 2.5;
}

.formation-spell-qty-btn:disabled {
  opacity: 0.36;
  cursor: default;
  box-shadow: none;
}

.formation-spell-qty-value {
  min-width: 0;
  color: rgba(49, 63, 52, 0.64);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.formation-spell-qty-value.is-on {
  color: #22543a;
}

.formation-cost-badge {
  position: absolute;
  z-index: 4;
  right: -5px;
  bottom: -3px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: white;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1;
  pointer-events: none;
  text-shadow: none;
}

.formation-cost-badge img {
  grid-area: 1 / 1;
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.formation-cost-text {
  grid-area: 1 / 1;
  position: relative;
  z-index: 1;
  transform: translateY(1px) scaleX(0.92);
}

.formation-cost-text-stroke {
  z-index: 1;
  color: #fff;
  -webkit-text-stroke: 3px #fff;
  text-shadow: none;
}

.formation-cost-text-fill {
  z-index: 2;
  color: #111;
}

.formation-slot-bg {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(34, 45, 36, 0.14));
}

.formation-apostle-img,
.formation-artifact-img {
  position: relative;
  max-width: 82%;
  max-height: 82%;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.18));
}

.formation-apostle-img {
  z-index: 2;
}

.formation-artifact-img {
  z-index: 3;
}

.formation-apostle-clip {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 17px;
  overflow: hidden;
}

.formation-apostle-img {
  width: 124%;
  height: 124%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  object-fit: cover;
  object-position: 50% 24%;
  image-rendering: auto;
  transform: translateZ(0);
  backface-visibility: hidden;
  clip-path: none;
  filter:
    drop-shadow(0 1px 2px rgba(0, 0, 0, 0.16));
}

.formation-apostle-badge {
  position: absolute;
  z-index: 4;
  width: 21px;
  height: 21px;
  object-fit: contain;
  filter:
    drop-shadow(0 1px 1px rgba(0, 0, 0, 0.26))
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.82));
}

.formation-personality-badge {
  left: -10px;
  top: -10px;
  width: 25px;
  height: 25px;
}

.formation-role-badge {
  left: -9px;
  top: 18px;
  width: 18px;
  height: 18px;
}

.formation-attack-badge {
  left: -9px;
  top: 40px;
  width: 18px;
  height: 18px;
}

.formation-empty-icon {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  font-weight: 950;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.36);
}

.formation-picker-dialog {
  width: min(860px, calc(100vw - 24px));
  max-height: min(760px, calc(100vh - 24px));
  border: 1px solid rgba(36, 83, 59, 0.18);
  border-radius: 22px;
  padding: 16px;
  color: var(--ink);
  background: rgba(255, 252, 242, 0.98);
  box-shadow: 0 28px 80px rgba(30, 42, 34, 0.38);
}

.formation-picker-dialog::backdrop {
  background: rgba(10, 16, 12, 0.45);
  backdrop-filter: blur(3px);
}

.formation-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.formation-picker-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.formation-picker-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 10px;
  margin-bottom: 10px;
}

.formation-picker-search {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.formation-picker-sort {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.formation-picker-search input,
.formation-picker-sort select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(36, 83, 59, 0.16);
  border-radius: 12px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.72);
}

.formation-filter-details {
  margin: 0 0 12px;
  border: 1px solid rgba(36, 83, 59, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
}

.formation-filter-details summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 950;
  cursor: pointer;
}

.formation-filter-details .apostle-picker-filters {
  padding: 0 10px 10px;
}

.formation-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  max-height: min(560px, calc(100vh - 210px));
  overflow: auto;
  padding-right: 4px;
}

.formation-picker-option {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(36, 83, 59, 0.14);
  border-radius: 14px;
  padding: 7px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  text-align: left;
}

.formation-picker-option.personality-純粋 { --formation-picker-personality-color: var(--personality-pure); }
.formation-picker-option.personality-冷静 { --formation-picker-personality-color: var(--personality-calm); }
.formation-picker-option.personality-狂気 { --formation-picker-personality-color: var(--personality-madness); }
.formation-picker-option.personality-活発 { --formation-picker-personality-color: var(--personality-active); }
.formation-picker-option.personality-憂鬱 { --formation-picker-personality-color: var(--personality-gloomy); }

.formation-picker-option[class*="personality-"] {
  border-color: color-mix(in srgb, var(--formation-picker-personality-color) 46%, white);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--formation-picker-personality-color) 22%, white),
      rgba(255, 255, 255, 0.78));
}

.formation-picker-option[class*="personality-"] .formation-picker-option-image-wrap {
  border-radius: 13px;
  background: color-mix(in srgb, var(--formation-picker-personality-color) 24%, white);
}

.formation-picker-option.rarity-signature {
  --formation-picker-card-color: rgba(168, 85, 247, 0.5);
  --formation-picker-card-glow: rgba(126, 34, 206, 0.16);
}

.formation-picker-option.rarity-legendary {
  --formation-picker-card-color: rgba(168, 85, 247, 0.48);
  --formation-picker-card-glow: rgba(126, 34, 206, 0.16);
}

.formation-picker-option.rarity-unique {
  --formation-picker-card-color: rgba(59, 130, 246, 0.45);
  --formation-picker-card-glow: rgba(37, 99, 235, 0.14);
}

.formation-picker-option.rarity-rare {
  --formation-picker-card-color: rgba(34, 197, 94, 0.42);
  --formation-picker-card-glow: rgba(22, 163, 74, 0.12);
}

.formation-picker-option[class*="rarity-"] {
  border-color: color-mix(in srgb, var(--formation-picker-card-color) 58%, white);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--formation-picker-card-color) 24%, white),
      rgba(255, 255, 255, 0.78));
  box-shadow: 0 4px 12px var(--formation-picker-card-glow);
}

.formation-picker-option[class*="rarity-"] .formation-picker-option-image-wrap {
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%,
      color-mix(in srgb, var(--formation-picker-card-color) 52%, white),
      color-mix(in srgb, var(--formation-picker-card-color) 22%, transparent) 68%,
      transparent 74%);
}

.formation-picker-option:hover {
  border-color: rgba(47, 119, 78, 0.34);
  background: rgba(255, 255, 255, 0.94);
}

.formation-picker-option[class*="rarity-"]:hover {
  border-color: color-mix(in srgb, var(--formation-picker-card-color) 76%, white);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--formation-picker-card-color) 34%, white),
      rgba(255, 255, 255, 0.9));
}

.formation-picker-option-image-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
}

.formation-picker-option-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.formation-picker-option-bg {
  position: absolute;
  inset: 0;
}

.formation-picker-option-image-wrap img:not(.formation-picker-option-bg) {
  position: relative;
  z-index: 1;
}

.formation-picker-option strong,
.formation-picker-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.formation-picker-option strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  font-size: 0.8rem;
  line-height: 1.22;
}

.formation-picker-option small {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.68rem;
}

.formation-picker-option-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.formation-picker-option-tools {
  position: absolute;
  z-index: 6;
  top: -3px;
  right: -3px;
  display: grid;
  place-items: center;
}

.formation-picker-effect-btn {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(36, 83, 59, 0.16);
  border-radius: 999px;
  color: rgba(49, 85, 60, 0.72);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
}

.formation-picker-effect-btn.has-effect {
  color: #f8fff7;
  border-color: rgba(49, 115, 71, 0.28);
  background: linear-gradient(135deg, #5da569, #3b7f4f);
}

.formation-picker-option-empty {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  color: rgba(39, 57, 42, 0.52);
  background: rgba(36, 83, 59, 0.08);
  font-size: 1.3rem;
  font-weight: 950;
}

.formation-picker-sort[hidden],
.formation-filter-details[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  body.dashboard-page.is-booting::after {
  content: '';
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 3001;
  width: 36px;
  height: 36px;
  background: url('img/NetworkIcon_Elena.png') center / contain no-repeat;
  opacity: 0.8;
  pointer-events: none;
}

:root {
    --dashboard-top-control-height: 3.25rem;
  }
}

@media (max-width: 900px) {
  body.dashboard-page.is-booting::after {
  content: '';
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 3001;
  width: 36px;
  height: 36px;
  background: url('img/NetworkIcon_Elena.png') center / contain no-repeat;
  opacity: 0.8;
  pointer-events: none;
}

:root {
    --dashboard-rail-width: 76px;
  }

  .dashboard-top-status span {
    display: none;
  }

  .dashboard-layout {
    gap: 10px;
    padding: 10px;
  }

  .dashboard-rail button {
    min-height: 66px;
    border-radius: 15px;
  }

  .skill-slider-grid {
    grid-template-columns: 1fr;
  }

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

  .apostle-info-profile,
  .profile-chip-row,
  .dashboard-stat-list {
    grid-column: 1;
    grid-row: auto;
  }

  .dashboard-stat-list {
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
  }

  .apostle-setting-sections {
    grid-template-columns: 1fr;
  }

  .growth-settings {
    grid-column: auto;
  }

}

@media (max-width: 700px) {
  .formation-save-panel {
    gap: 4px;
    margin-bottom: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .formation-save-main {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
  }

  .formation-save-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 3px;
  }

  .formation-save-actions button {
    flex: 0 0 auto;
    min-height: 26px;
    padding: 0 8px;
    font-size: 0.64rem;
  }

  .formation-save-fields {
    grid-template-columns: 1fr;
  }

  .formation-active-preset {
    min-height: 26px;
    padding: 2px 7px;
    font-size: 0.62rem;
    background: rgba(255, 255, 255, 0.32);
  }

  .formation-active-preset strong {
    font-size: 0.68rem;
  }

  .formation-active-preset small {
    display: none;
  }

  .formation-save-list {
    gap: 4px;
  }

  .formation-preset-shortcuts {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    padding-bottom: 1px;
    scrollbar-width: none;
  }

  .formation-preset-shortcuts::-webkit-scrollbar {
    display: none;
  }

  .formation-preset-shortcuts button {
    flex: 0 0 28px;
    min-height: 26px;
    grid-template-columns: auto;
    justify-content: center;
    border: 0;
    padding: 2px;
    background: transparent;
    box-shadow: none;
  }

  .formation-preset-shortcuts button span {
    width: 24px;
    height: 24px;
  }

  .formation-preset-shortcuts button strong {
    display: none;
  }

  .formation-preset-shortcuts button.is-selected {
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .formation-preset-shortcuts button.is-selected span {
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.9),
      0 0 0 4px rgba(65, 151, 75, 0.28);
  }

  .formation-preset-details summary {
    min-height: 26px;
    padding: 0 8px;
    font-size: 0.68rem;
  }

  .formation-preset-details summary::after {
    width: 18px;
    height: 18px;
  }

  .formation-preset-list {
    grid-template-columns: 1fr;
  }

  .formation-save-empty {
    padding: 2px 2px 0;
    font-size: 0.64rem;
  }

  .formation-coin-box {
    grid-template-columns: repeat(3, minmax(46px, 1fr));
    justify-content: stretch;
    gap: 2px;
    padding: 4px 5px;
  }

  .formation-coin-owned,
  .formation-total-cost,
  .formation-coin-remain {
    display: grid;
    grid-template-rows: 0.9rem 30px;
    justify-items: center;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    font-size: 0.6rem;
    line-height: 1;
    text-align: center;
  }

  .formation-coin-owned > span:first-child,
  .formation-total-cost > span:first-child,
  .formation-coin-remain > span:first-child {
    display: grid;
    place-items: center;
    min-height: 0.9rem;
  }

  .formation-coin-input-wrap,
  .formation-coin-input-wrap img,
  .formation-total-cost .formation-cost-badge {
    width: 28px;
    height: 28px;
  }

  .formation-coin-input-wrap,
  .formation-total-cost .formation-cost-badge,
  .formation-coin-remain .formation-metric-number {
    justify-self: center;
    align-self: center;
  }

  .formation-coin-owned .formation-coin-display,
  .formation-total-cost .formation-cost-text,
  .formation-coin-remain .formation-metric-number {
    font-size: 0.82rem;
  }

  .formation-coin-popover {
    left: auto;
    right: -0.4rem;
    min-width: min(9.2rem, 78vw);
    transform: none;
  }

  .formation-coin-remain {
    grid-column: auto;
  }

  .formation-coin-remain strong {
    min-height: 28px;
    display: grid;
    place-items: center;
  }

  .formation-spell-list {
    padding: 6px;
  }

  .formation-master-power {
    padding: 7px;
  }

  .formation-spell-catalog {
    gap: 5px;
    padding: 6px;
    max-height: 386px;
  }

  .formation-spell-card {
    width: 72px;
    min-height: 110px;
    grid-template-rows: 56px 27px 19px;
    gap: 3px;
    padding: 3px;
  }

  .formation-spell-card-art {
    height: 56px;
  }

  .formation-spell-qty {
    grid-template-columns: 18px 1fr 18px;
  }

  .formation-spell-qty-btn {
    width: 18px;
    height: 16px;
    font-size: 0.68rem;
  }

  .formation-spell-selected-card {
    width: 44px;
  }

  .card-manager-kind-grid {
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 7px;
  }

  .resource-card {
    --card-name-panel-height: 40%;
    border-radius: 10px;
  }

  .resource-card-image-wrap {
    border-width: 2px !important;
    border-radius: 8px !important;
  }

  .resource-card-name-panel {
    padding: 18px 4px 4px;
    font-size: clamp(0.48rem, 2.05vw, 0.58rem);
    line-height: 1.04;
  }

  .resource-card-name-panel span {
    -webkit-line-clamp: 2;
  }

  .resource-card-cost {
    top: 3px;
    right: 3px;
    width: 24px;
  }

  .resource-card-cost-value-fill,
  .resource-card-cost-value {
    font-size: 0.78rem;
  }

  .resource-card-star-overlay {
    display: none;
  }

  .resource-solder-overlay {
    display: none;
  }

  .resource-solder-overlay.has-solder {
    right: 3px;
    bottom: calc(var(--card-name-panel-height) + 2px);
    width: 24px;
    height: 24px;
    display: block;
    cursor: default;
  }

  .resource-solder-overlay.has-solder .resource-solder-token-icon {
    width: 24px;
    height: 24px;
  }

  .resource-card-mobile-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-top: 5px;
  }

  .resource-card-mobile-controls select {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 0 3px;
    border: 1px solid rgba(97, 74, 52, 0.26);
    border-radius: 8px;
    color: #3f342c;
    background: rgba(255, 250, 235, 0.94);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 900;
    text-align: center;
    touch-action: manipulation;
  }

  .resource-card-mobile-controls select:disabled {
    color: rgba(63, 52, 44, 0.46);
    background: rgba(226, 232, 240, 0.72);
    opacity: 0.72;
  }

  .resource-card-mobile-solder {
    position: relative;
    min-width: 0;
  }

  .resource-card-mobile-solder img {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 3px;
    width: 13px;
    height: 13px;
    object-fit: contain;
    pointer-events: none;
    transform: translateY(-50%);
  }

  .resource-card-mobile-solder select {
    padding-left: 14px;
  }

  .formation-board {
    grid-template-columns: repeat(3, minmax(112px, 132px));
    gap: 0;
    justify-content: center;
    overflow-x: visible;
    padding-inline: 0;
  }

  .formation-column {
    --formation-notch: 16px;
    width: clamp(112px, 30vw, 132px);
    min-width: 112px;
    max-width: 132px;
    padding: 11px 17px 11px 13px;
  }

  .formation-column-1 {
    transform: translateX(10px);
  }

  .formation-column-3 {
    transform: translateX(-10px);
  }

  .formation-column::before,
  .formation-column::after {
    clip-path: polygon(0 0, calc(100% - var(--formation-notch)) 0, 100% 50%, calc(100% - var(--formation-notch)) 100%, 0 100%, var(--formation-notch) 50%);
    border-radius: 0;
  }

  .formation-line {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 4px;
    padding: 7px 0;
  }

  .formation-line:nth-of-type(3) {
    transform: translateX(8px);
  }

  .formation-apostle-slot {
    width: 64px;
    height: 64px;
    border-radius: 15px;
  }

  .formation-artifact-list {
    grid-template-columns: repeat(3, 32px);
    justify-content: center;
    gap: 2px;
  }

  .formation-artifact-slot {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 600px) {
  .formation-picker-tools {
    grid-template-columns: 1fr;
  }

  .formation-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  }

  .formation-picker-option {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 6px;
    min-height: 54px;
    padding: 5px;
  }

  .formation-picker-option-image-wrap,
  .formation-picker-option-empty {
    width: 44px;
    height: 44px;
  }

  .formation-picker-effect-btn {
    width: 20px;
    height: 20px;
    font-size: 0.64rem;
  }

  .formation-picker-option strong {
    font-size: 0.74rem;
    line-height: 1.18;
  }

  .formation-picker-option small {
    font-size: 0.62rem;
  }
}

@media (max-width: 700px) {
  body.dashboard-page.is-booting::after {
  content: '';
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 3001;
  width: 36px;
  height: 36px;
  background: url('img/NetworkIcon_Elena.png') center / contain no-repeat;
  opacity: 0.8;
  pointer-events: none;
}

:root {
    --dashboard-bar-height: 44px;
    --dashboard-bottom-control-height: 40px;
  }

  .dashboard-page {
    padding-bottom: calc(var(--dashboard-bar-height) + 8px);
  }

  .theme-toggle {
    padding: 7px 10px;
    font-size: 0.68rem;
  }

  .dashboard-layout {
    display: block;
    padding: 8px;
  }

  .dashboard-rail {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 8px;
    padding: 5px;
  }

  .dashboard-rail button {
    width: 100%;
    min-height: 44px;
    display: flex;
    gap: 4px;
    border-radius: 11px;
    padding: 3px 5px;
  }

  .dashboard-rail-icon {
    width: 30px;
    height: 30px;
    border-width: 1px;
  }

  .dashboard-rail-icon img {
    width: 23px;
    height: 23px;
  }

  .dashboard-rail button strong {
    font-size: 0.62rem;
  }

  .dashboard-rail .rail-equipment {
    width: 100%;
    margin: 0;
  }

  .dashboard-card {
    width: 100%;
    max-width: calc(100vw - 16px);
    border-radius: 18px;
    padding: 13px;
    overflow: hidden;
  }

  .formation-panel {
    overflow: visible;
  }

  .formation-board {
    grid-template-columns: repeat(3, minmax(104px, 132px));
  }

  .formation-column {
    width: clamp(104px, 31vw, 132px);
    min-width: 104px;
    padding: 11px 17px 11px 13px;
  }

  .formation-cost-badge {
    right: -5px;
    bottom: -4px;
    width: 24px;
    height: 24px;
    font-size: 0.76rem;
  }

  .formation-apostle-badge {
    width: 15px;
    height: 15px;
  }

  .formation-personality-badge {
    width: 21px;
    height: 21px;
  }

  .apostle-info-card {
    gap: 14px;
  }

  .dashboard-portrait {
    width: 84px;
    height: 84px;
  }

  .apostle-info-profile h2 {
    font-size: 1.3rem;
  }

  .dashboard-stat-list {
    grid-template-columns: 1fr;
  }

  .dashboard-stat-list .stat-inline {
    min-width: 0;
  }

  .dashboard-card .stat-breakdown-table,
  .dashboard-card .research-table-wrap,
  .dashboard-card .compact-table-wrap {
    overflow-x: auto;
  }

  .dashboard-card .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .equipment-dashboard-head {
    flex-direction: row !important;
    align-items: end !important;
  }

  .rank-inline-control {
    width: 112px;
  }

  .equipment-orbit {
    width: 340px;
    max-width: 100%;
    height: 350px;
    margin-bottom: 12px;
  }

  .equipment-center-apostle {
    width: 104px;
  }

  .equipment-center-portrait {
    width: 100px;
    height: 100px;
    border-radius: 50%;
  }

  .dashboard-page .equipment-orbit-slot {
    width: 82px;
    min-height: 96px;
    border-radius: 18px;
    padding: 5px;
  }

  .dashboard-page .equipment-orbit-slot.slot-1 { left: 30%; top: 15%; }
  .dashboard-page .equipment-orbit-slot.slot-2 { left: 70%; top: 15%; }
  .dashboard-page .equipment-orbit-slot.slot-3 { left: 14%; top: 50%; }
  .dashboard-page .equipment-orbit-slot.slot-4 { left: 86%; top: 50%; }
  .dashboard-page .equipment-orbit-slot.slot-5 { left: 30%; top: 85%; }
  .dashboard-page .equipment-orbit-slot.slot-6 { left: 70%; top: 85%; }

  .dashboard-page .equipment-orbit-slot .kind,
  .dashboard-page .equipment-orbit-slot .tier {
    font-size: 0.55rem;
  }

  .dashboard-page .equipment-orbit-slot .equip-icon {
    width: 48px;
    height: 48px;
  }

  .dashboard-page .equipment-orbit-slot .equip-toggle {
    padding: 3px 4px;
    font-size: 0.55rem;
  }

  .dashboard-page .equipment-orbit-slot .equip-enhance {
    width: 38px;
    min-height: 23px;
    font-size: 0.58rem;
  }

  .equipment-value-table th,
  .equipment-value-table td {
    padding: 7px 8px;
    font-size: 0.66rem;
  }

  .equipment-rank-effect-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .dashboard-bottom-bar {
    bottom: 0;
    width: 100%;
    min-height: var(--dashboard-bar-height);
    gap: 2px;
    border-radius: 0;
    padding: 2px max(4px, env(safe-area-inset-right)) calc(2px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
    overflow: visible;
    justify-content: center;
  }

  .dashboard-bottom-bar button,
  .bottom-save-menu summary,
  .bottom-global-menu summary {
    height: var(--dashboard-bottom-control-height);
    min-height: 0;
    flex: 0 0 auto;
    border-radius: 9px;
    padding: 0 5px;
    font-size: 0.64rem;
  }

  .bottom-apostle-button {
    width: auto;
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
    padding-right: 5px !important;
  }

  .bottom-save-menu,
  .bottom-global-menu {
    flex: 0 0 auto;
  }

  .bottom-global-menu summary {
    min-width: 40px;
    padding: 0 5px;
  }

  .bottom-save-popover,
  .bottom-global-popover {
    left: 0;
    transform: none;
  }

  .bottom-save-popover {
    width: min(268px, calc(100vw - 18px));
    right: 0;
    left: auto;
  }

  .bottom-global-popover {
    width: min(210px, calc(100vw - 18px));
  }

  .setting-field-grid,
  .setting-field-grid.compact,
  .growth-settings .setting-field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .refined-follow-toggle {
    grid-column: 1 / -1;
  }

  .skill-field-grid {
    grid-template-columns: 1fr;
  }

  .board-quick-button,
  .card-quick-button,
  .bottom-section-button {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    display: grid;
    grid-template-rows: 22px 1fr;
    gap: 0;
    padding: 1px !important;
    font-size: 0.54rem;
    justify-content: center;
  }

  .bottom-section-icon {
    width: 21px;
    height: 21px;
    flex-basis: 21px;
    justify-self: center;
  }

  .bottom-section-icon img {
    width: 16px;
    height: 16px;
  }

  .bottom-section-button strong {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
    transform: none;
    line-height: 0.9;
  }

  .bottom-section-button strong span {
    display: block;
    line-height: 0.92;
    overflow-wrap: normal;
    word-break: keep-all;
    white-space: normal;
  }

  .bottom-save-trigger strong span[data-compact-label] {
    font-size: 0;
  }

  .bottom-save-trigger strong span[data-compact-label]::after {
    content: attr(data-compact-label);
    font-size: 0.56rem;
    line-height: 0.95;
  }

  .bottom-section-button strong span::before {
    display: none;
  }

  .dashboard-bottom-bar .bottom-section-button.is-active strong,
  .dashboard-bottom-bar .bottom-save-menu[open] .bottom-save-trigger strong {
    color: #164b2d !important;
    text-shadow:
      0 1px 0 rgba(255, 255, 255, 0.96),
      0 0 5px rgba(71, 156, 95, 0.42),
      0 0 10px rgba(71, 156, 95, 0.22);
  }

  :root[data-theme="dark"] .dashboard-bottom-bar .bottom-section-button.is-active strong,
  :root[data-theme="dark"] .dashboard-bottom-bar .bottom-save-menu[open] .bottom-save-trigger strong {
    color: #ffffff !important;
    text-shadow:
      0 0 5px rgba(255, 255, 255, 0.84),
      0 0 12px rgba(196, 181, 253, 0.72),
      0 1px 2px rgba(0, 0, 0, 0.6);
  }

  .bottom-save-menu summary,
  .bottom-global-menu summary {
    width: 38px;
    min-width: 38px;
    padding-inline: 3px;
    line-height: 1.02;
  }

  .bottom-save-menu summary.bottom-save-trigger {
    width: 58px;
    min-width: 58px;
    flex-basis: 58px;
    display: grid;
    grid-template-rows: 22px 1fr;
    justify-content: center;
    gap: 0;
    padding-inline: 1px 3px !important;
  }

  .bottom-save-trigger .bottom-section-icon {
    justify-self: center;
  }

  .bottom-save-trigger strong {
    width: auto;
    font-size: 0.52rem;
    line-height: 0.95;
    transform: none;
    text-align: center;
  }

  .bottom-save-trigger strong span {
    white-space: normal;
    line-height: 0.95;
  }

  .bottom-global-menu summary strong {
    line-height: 1.02;
  }
}

@media (max-width: 360px) {
  .dashboard-layout {
    padding-inline: 4px;
  }

  .dashboard-card {
    max-width: calc(100vw - 8px);
  }

  .formation-panel {
    padding-inline: 6px;
    overflow: hidden;
  }

  .formation-layout,
  .formation-overview-row,
  .formation-overview-side,
  .formation-member-summary,
  .formation-board,
  .formation-spell-list,
  .formation-master-power {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .formation-master-power-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .formation-master-power-card {
    grid-template-columns: 70px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
  }

  .formation-master-power-media {
    grid-row: 1 / 3;
  }

  .formation-master-power-card > strong,
  .formation-master-power-card > small {
    text-align: left;
    justify-content: flex-start;
  }

  .formation-master-power-detail > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  .formation-overview-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .formation-overview-side {
    justify-items: stretch;
  }

  .formation-member-summary {
    justify-content: flex-start;
  }

  .formation-cost-summary {
    position: relative;
    top: auto;
    width: 100%;
    margin-top: 0;
    justify-self: stretch;
  }
  .formation-coin-box {
    width: auto;
  }

  .formation-coin-owned {
    position: static;
  }

  .formation-coin-popover {
    right: 0;
    left: auto;
    width: min(300px, calc(100vw - 40px));
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .formation-coin-auto-note,
  .formation-coin-popover label,
  .formation-coin-popover [data-formation-coin-close] {
    grid-column: 1 / -1;
  }

  .formation-board {
    width: calc(100% + 8px);
    max-width: calc(100% + 8px);
    margin-right: -4px;
    margin-left: -4px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    padding: 18px 0 22px;
  }

  .formation-column {
    --formation-notch: 10px;
    width: 100%;
    min-width: 0;
    max-width: none;
    gap: 6px;
    padding: 9px 3px;
  }

  .formation-column-1,
  .formation-column-3,
  .formation-line:nth-of-type(3) {
    transform: none;
  }

  .formation-column-head {
    top: -12px;
    right: 5px;
  }

  .formation-column-head button {
    width: 26px;
    height: 26px;
  }

  .formation-line {
    width: 100%;
    min-width: 0;
    gap: 3px;
    padding: 5px 0;
  }

  .formation-apostle-slot {
    width: 54px;
    height: 54px;
    border-radius: 13px;
  }

  .formation-artifact-list {
    grid-template-columns: repeat(3, 25px);
    gap: 1px;
    justify-content: center;
  }

  .formation-artifact-slot {
    width: 25px;
    height: 25px;
  }

  .formation-spell-list {
    padding-inline: 4px;
  }

  .formation-spell-head {
    flex-wrap: wrap;
    gap: 5px;
  }

  .dashboard-bottom-bar {
    gap: 1px;
    padding-right: 2px;
    padding-left: 2px;
    overflow: hidden;
  }

  .bottom-apostle-button {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    flex: 0 0 58px;
    gap: 1px;
    padding: 1px !important;
  }

  .bottom-apostle-button img {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 9px;
  }

  .bottom-apostle-button span {
    gap: 0;
  }

  .bottom-apostle-button small {
    font-size: 0;
  }

  .bottom-apostle-button small::after {
    content: "使徒\A選択";
    font-size: 0.46rem;
    line-height: 1.05;
    white-space: pre;
  }

  .bottom-apostle-button strong {
    display: none;
  }

  .board-quick-button,
  .card-quick-button,
  .bottom-section-button {
    flex-basis: 34px;
    width: 34px;
    min-width: 34px;
    grid-template-rows: 1fr;
    font-size: 0.52rem;
  }

  .bottom-section-icon {
    display: none;
  }

  .bottom-save-menu summary.bottom-save-trigger {
    width: 36px;
    min-width: 36px;
    flex-basis: 36px;
    grid-template-rows: 1fr;
  }

  .resource-card-name-panel {
    padding-top: 17px;
    font-size: 0.47rem;
  }

  .resource-card-star-overlay {
    transform: translateX(-50%) scale(0.7);
  }
}

:root[data-theme="dark"] .dashboard-page {
  color: var(--ink);
}

:root[data-theme="dark"] .dashboard-stat-list .stat-inline {
  border-bottom-color: rgba(148, 163, 184, 0.14);
}

:root[data-theme="dark"] .dashboard-stat-list .stat-inline.hp {
  color: #86efac;
}

:root[data-theme="dark"] .dashboard-stat-list .stat-inline.attack {
  color: #fca5a5;
}

:root[data-theme="dark"] .dashboard-stat-list .stat-inline.defense {
  color: #93c5fd;
}

:root[data-theme="dark"] .dashboard-stat-list .stat-inline.crit {
  color: #fbbf24;
}

:root[data-theme="dark"] .dashboard-stat-list .stat-inline.crit-res {
  color: #d8b4fe;
}

:root[data-theme="dark"] .dashboard-stat-list .stat-inline.combat-power {
  color: #fbbf24;
  border-bottom-color: rgba(251, 191, 36, 0.2);
}

:root[data-theme="dark"] .combat-power-icon {
  color: #fff7ed;
  background: linear-gradient(135deg, #fbbf24, #f97316 52%, #be123c);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.2), 0 2px 8px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .dashboard-stat-list .stat-inline .label {
  color: color-mix(in srgb, currentColor 72%, rgba(226, 232, 240, 0.78));
}

:root[data-theme="dark"] .dashboard-stat-list .stat-inline .value {
  color: color-mix(in srgb, currentColor 42%, #ffffff);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .summary-toggle-label {
  color: #e0f2fe;
  border-color: rgba(125, 211, 252, 0.3);
  background: rgba(14, 165, 233, 0.16);
}

:root[data-theme="dark"] .summary-toggle-label:hover,
:root[data-theme="dark"] .summary-toggle-label:focus-visible {
  color: #ffffff;
  border-color: rgba(196, 181, 253, 0.46);
  background: rgba(99, 102, 241, 0.24);
}

:root[data-theme="dark"] .effect-details[open] .summary-toggle-label {
  color: #ffffff;
  border-color: rgba(196, 181, 253, 0.55);
  background: linear-gradient(135deg, var(--dashboard-dark-primary), var(--dashboard-dark-accent));
}

:root[data-theme="dark"] .effect-details {
  border-top-color: rgba(148, 163, 184, 0.16);
}

:root[data-theme="dark"] .skill-info-card,
:root[data-theme="dark"] .aside-info-card,
:root[data-theme="dark"] .skill-slider-field,
:root[data-theme="dark"] .skill-level-field {
  color: var(--ink);
  border-color: rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(135deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.66));
}

:root[data-theme="dark"] .skill-info-icon,
:root[data-theme="dark"] .aside-info-icon,
:root[data-theme="dark"] .aside-rank-chip,
:root[data-theme="dark"] .skill-info-icon-placeholder,
:root[data-theme="dark"] .skill-setting-icon {
  color: #f8fafc;
  background: rgba(99, 102, 241, 0.18);
  box-shadow: inset 0 0 0 1px rgba(196, 181, 253, 0.16);
}

:root[data-theme="dark"] .skill-info-title strong,
:root[data-theme="dark"] .aside-info-body strong,
:root[data-theme="dark"] .aside-tier-panel h3 {
  color: #ddd6fe;
}

:root[data-theme="dark"] .skill-info-title span,
:root[data-theme="dark"] .aside-info-body > span,
:root[data-theme="dark"] .skill-info-body p,
:root[data-theme="dark"] .aside-info-body p {
  color: rgba(226, 232, 240, 0.78);
}

:root[data-theme="dark"] .skill-info-title em,
:root[data-theme="dark"] .skill-slider-field output {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.14);
}

:root[data-theme="dark"] .skill-info-effects span {
  color: #e0f2fe;
  border-color: rgba(125, 211, 252, 0.2);
  background: rgba(14, 165, 233, 0.12);
}

:root[data-theme="dark"] .aside-info-card.is-empty {
  opacity: 0.72;
  filter: grayscale(0.2);
}

:root[data-theme="dark"] .panel-head p,
:root[data-theme="dark"] .dashboard-card p,
:root[data-theme="dark"] .muted,
:root[data-theme="dark"] .active-effect-list,
:root[data-theme="dark"] .equipment-rank-effect-head small,
:root[data-theme="dark"] .skill-level-cap-note,
:root[data-theme="dark"] .formation-spell-head small,
:root[data-theme="dark"] .formation-spell-empty,
:root[data-theme="dark"] .formation-picker-option small,
:root[data-theme="dark"] .formation-save-item small,
:root[data-theme="dark"] .resource-card small {
  color: rgba(226, 232, 240, 0.78);
}

:root[data-theme="dark"] .dashboard-card h2,
:root[data-theme="dark"] .dashboard-card h3,
:root[data-theme="dark"] .panel-head h2,
:root[data-theme="dark"] .panel-head h3,
:root[data-theme="dark"] .formation-spell-head,
:root[data-theme="dark"] .formation-spell-detail-title,
:root[data-theme="dark"] .formation-picker-head h2,
:root[data-theme="dark"] .formation-picker-option strong,
:root[data-theme="dark"] .formation-save-item strong,
:root[data-theme="dark"] .resource-card strong {
  color: rgba(248, 250, 252, 0.96);
}

:root[data-theme="dark"] .formation-spell-detail-toggle {
  color: #e0f2fe;
  border-color: rgba(125, 211, 252, 0.24);
  background: rgba(14, 165, 233, 0.14);
}

:root[data-theme="dark"] .formation-spell-detail-toggle:not(:disabled):hover {
  color: #ffffff;
  border-color: rgba(196, 181, 253, 0.42);
  background: rgba(99, 102, 241, 0.24);
}

:root[data-theme="dark"] .formation-spell-detail-list {
  background: rgba(7, 12, 18, 0.24);
}

:root[data-theme="dark"] .formation-spell-detail-card {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--formation-spell-color) 54%, rgba(255, 255, 255, 0.14));
  background: color-mix(in srgb, var(--formation-spell-color) 18%, rgba(15, 23, 42, 0.84));
}

:root[data-theme="dark"] .formation-spell-detail-title span {
  color: #e0f2fe;
  background: rgba(15, 23, 42, 0.48);
}

:root[data-theme="dark"] .formation-spell-detail-body p {
  color: rgba(226, 232, 240, 0.78);
}

:root[data-theme="dark"] .formation-spell-list,
:root[data-theme="dark"] .formation-master-power,
:root[data-theme="dark"] .formation-filter-details,
:root[data-theme="dark"] .formation-spell-catalog,
:root[data-theme="dark"] .formation-save-editor,
:root[data-theme="dark"] .formation-save-list,
:root[data-theme="dark"] .card-manager-controls,
:root[data-theme="dark"] .card-manager-summary,
:root[data-theme="dark"] .board-global-progress-summary,
:root[data-theme="dark"] .board-draft-summary,
:root[data-theme="dark"] .board-selection-summary {
  color: var(--ink);
  border-color: rgba(74, 222, 128, 0.16);
  background:
      linear-gradient(135deg, rgba(12, 28, 24, 0.82), rgba(12, 20, 34, 0.78));
}

:root[data-theme="dark"] .formation-master-power {
  border-color: rgba(167, 139, 250, 0.22);
  background: linear-gradient(135deg, rgba(34, 25, 56, 0.86), rgba(14, 22, 35, 0.82));
}

:root[data-theme="dark"] .formation-master-power-head,
:root[data-theme="dark"] .formation-master-power-detail > div:first-child strong {
  color: rgba(237, 233, 254, 0.96);
}

:root[data-theme="dark"] .formation-master-power-head small,
:root[data-theme="dark"] .formation-master-power-detail,
:root[data-theme="dark"] .formation-master-power-detail > div:first-child span {
  color: rgba(221, 214, 254, 0.74);
}

:root[data-theme="dark"] .formation-master-power-card {
  color: rgba(237, 233, 254, 0.94);
  border-color: rgba(167, 139, 250, 0.2);
  background: rgba(25, 23, 39, 0.84);
  box-shadow: 0 5px 12px rgba(5, 5, 12, 0.26);
}

:root[data-theme="dark"] .formation-master-power-card:hover,
:root[data-theme="dark"] .formation-master-power-card:focus-visible {
  border-color: rgba(196, 181, 253, 0.52);
  background: rgba(48, 38, 72, 0.92);
}

:root[data-theme="dark"] .formation-master-power-card.is-selected {
  border-color: rgba(192, 132, 252, 0.9);
  background: linear-gradient(145deg, rgba(73, 48, 112, 0.96), rgba(31, 27, 48, 0.94));
  box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.2), 0 8px 18px rgba(5, 5, 12, 0.34);
}

:root[data-theme="dark"] .formation-master-power-card > small {
  color: rgba(221, 214, 254, 0.7);
}

:root[data-theme="dark"] .formation-master-power-detail {
  background: rgba(7, 12, 18, 0.3);
}

:root[data-theme="dark"] .formation-master-power-effects span {
  color: rgba(237, 233, 254, 0.9);
  border-color: rgba(192, 132, 252, 0.2);
  background: rgba(88, 55, 125, 0.46);
}

:root[data-theme="dark"] .board-draft-summary .board-change-section,
:root[data-theme="dark"] .board-selection-summary .board-change-section {
  color: rgba(238, 247, 242, 0.94);
  border: 1px solid rgba(74, 222, 128, 0.12);
  border-radius: 14px;
  background: rgba(7, 12, 18, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .board-draft-summary .summary-table-grid,
:root[data-theme="dark"] .board-selection-summary .summary-table-grid {
  background: transparent;
}

:root[data-theme="dark"] .board-draft-summary .board-effect-table,
:root[data-theme="dark"] .board-selection-summary .board-effect-table {
  color: rgba(238, 247, 242, 0.94);
  border-color: rgba(74, 222, 128, 0.13);
  background: rgba(5, 10, 16, 0.48);
}

:root[data-theme="dark"] .board-draft-summary .board-effect-table thead th,
:root[data-theme="dark"] .board-selection-summary .board-effect-table thead th {
  color: rgba(226, 232, 240, 0.86);
  background: rgba(16, 36, 34, 0.86);
}

:root[data-theme="dark"] .board-draft-summary .board-effect-table tbody th,
:root[data-theme="dark"] .board-selection-summary .board-effect-table tbody th {
  color: rgba(226, 232, 240, 0.9);
}

:root[data-theme="dark"] .board-draft-summary .board-effect-table td,
:root[data-theme="dark"] .board-selection-summary .board-effect-table td {
  color: rgba(241, 245, 249, 0.92);
}

:root[data-theme="dark"] .board-draft-summary .board-effect-table .value,
:root[data-theme="dark"] .board-selection-summary .board-effect-table .value {
  color: #fef3c7;
  background: transparent;
}

:root[data-theme="dark"] .board-draft-summary .board-effect-group th,
:root[data-theme="dark"] .board-selection-summary .board-effect-group th {
  color: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .board-draft-summary .board-effect-group.is-special th,
:root[data-theme="dark"] .board-selection-summary .board-effect-group.is-special th {
  background: rgba(126, 34, 206, 0.42);
}

:root[data-theme="dark"] .board-draft-summary .board-effect-group.is-advanced th,
:root[data-theme="dark"] .board-selection-summary .board-effect-group.is-advanced th {
  background: rgba(30, 64, 175, 0.38);
}

:root[data-theme="dark"] .board-draft-summary .board-effect-group.is-lower th,
:root[data-theme="dark"] .board-selection-summary .board-effect-group.is-lower th {
  background: rgba(22, 101, 52, 0.36);
}

:root[data-theme="dark"] .formation-picker-option,
:root[data-theme="dark"] .formation-save-item {
  color: var(--ink);
  background-color: rgba(20, 34, 52, 0.88);
}

:root[data-theme="dark"] .formation-picker-option.personality-純粋 { --formation-picker-personality-color: var(--personality-pure); }
:root[data-theme="dark"] .formation-picker-option.personality-冷静 { --formation-picker-personality-color: var(--personality-calm); }
:root[data-theme="dark"] .formation-picker-option.personality-狂気 { --formation-picker-personality-color: var(--personality-madness); }
:root[data-theme="dark"] .formation-picker-option.personality-活発 { --formation-picker-personality-color: var(--personality-active); }
:root[data-theme="dark"] .formation-picker-option.personality-憂鬱 { --formation-picker-personality-color: var(--personality-gloomy); }

:root[data-theme="dark"] .formation-picker-option[class*="personality-"] {
  border-color: color-mix(in srgb, var(--formation-picker-personality-color) 66%, rgba(255, 255, 255, 0.22));
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--formation-picker-personality-color) 46%, rgba(255, 255, 255, 0.1)),
      color-mix(in srgb, var(--formation-picker-personality-color) 24%, rgba(15, 23, 42, 0.36))) !important;
}

:root[data-theme="dark"] .formation-picker-option[class*="personality-"] .formation-picker-option-image-wrap {
  background: color-mix(in srgb, var(--formation-picker-personality-color) 36%, rgba(255, 255, 255, 0.08));
}

:root[data-theme="dark"] .formation-picker-option.rarity-signature {
  --formation-picker-card-color: rgba(232, 121, 249, 0.5);
  --formation-picker-card-glow: rgba(217, 70, 239, 0.18);
}

:root[data-theme="dark"] .formation-picker-option.rarity-legendary {
  --formation-picker-card-color: rgba(192, 132, 252, 0.5);
  --formation-picker-card-glow: rgba(168, 85, 247, 0.16);
}

:root[data-theme="dark"] .formation-picker-option.rarity-unique {
  --formation-picker-card-color: rgba(96, 165, 250, 0.5);
  --formation-picker-card-glow: rgba(59, 130, 246, 0.15);
}

:root[data-theme="dark"] .formation-picker-option.rarity-rare {
  --formation-picker-card-color: rgba(74, 222, 128, 0.46);
  --formation-picker-card-glow: rgba(34, 197, 94, 0.14);
}

:root[data-theme="dark"] .formation-picker-option[class*="rarity-"] {
  border-color: color-mix(in srgb, var(--formation-picker-card-color) 46%, rgba(226, 232, 240, 0.18));
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--formation-picker-card-color) 24%, rgba(15, 23, 42, 0.9)),
      rgba(20, 34, 52, 0.86)) !important;
  box-shadow: 0 5px 14px var(--formation-picker-card-glow);
}

:root[data-theme="dark"] .formation-picker-option[class*="rarity-"] .formation-picker-option-image-wrap {
  background:
    radial-gradient(circle at 50% 42%,
      color-mix(in srgb, var(--formation-picker-card-color) 34%, rgba(255, 255, 255, 0.08)),
      color-mix(in srgb, var(--formation-picker-card-color) 18%, rgba(15, 23, 42, 0.26)) 68%,
      transparent 74%);
}

:root[data-theme="dark"] .resource-card {
  color: var(--ink);
  background: transparent;
}

:root[data-theme="dark"] .resource-card-image-wrap {
  background: transparent;
}

:root[data-theme="dark"] .formation-apostle-slot,
:root[data-theme="dark"] .formation-artifact-slot,
:root[data-theme="dark"] .formation-spell-selected-card {
  background: transparent;
}

:root[data-theme="dark"] .formation-apostle-slot.is-filled {
  border-color: color-mix(in srgb, var(--formation-personality-color) 78%, white);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--formation-personality-color) 56%, white),
      color-mix(in srgb, var(--formation-personality-color) 32%, white));
}

:root[data-theme="dark"] .formation-spell-card {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .formation-spell-name,
:root[data-theme="dark"] .formation-spell-qty-value,
:root[data-theme="dark"] .formation-spell-qty-value.is-on {
  color: rgba(248, 250, 252, 0.92);
}

:root[data-theme="dark"] .formation-spell-qty {
  background: rgba(15, 23, 42, 0.74);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

:root[data-theme="dark"] .formation-picker-search,
:root[data-theme="dark"] .formation-picker-sort {
  color: rgba(226, 232, 240, 0.82);
}

:root[data-theme="dark"] .formation-filter-details summary,
:root[data-theme="dark"] .formation-picker-effect-btn {
  color: rgba(248, 250, 252, 0.92);
}

:root[data-theme="dark"] .formation-picker-effect-btn {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(30, 41, 59, 0.86);
}

:root[data-theme="dark"] .formation-picker-effect-btn.has-effect {
  color: #ffffff;
  border-color: rgba(196, 181, 253, 0.36);
  background: linear-gradient(135deg, var(--dashboard-dark-primary), var(--dashboard-dark-accent));
}

:root[data-theme="dark"] button.resource-effect-overlay {
  color: #f8fafc !important;
  border-color: rgba(96, 165, 250, 0.46) !important;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.94), rgba(29, 78, 216, 0.94)) !important;
}

:root[data-theme="dark"] button.resource-effect-overlay:hover:not(:disabled),
:root[data-theme="dark"] button.resource-effect-overlay:focus-visible,
:root[data-theme="dark"] .formation-picker-effect-btn:hover,
:root[data-theme="dark"] .formation-picker-effect-btn:focus-visible {
  color: #ffffff !important;
  border-color: rgba(216, 180, 254, 0.72) !important;
  background: linear-gradient(135deg, #6366f1, #0f9f8f) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 5px 12px rgba(0, 0, 0, 0.32) !important;
}

:root[data-theme="dark"] button.resource-effect-overlay:not(.has-effect) {
  border-color: rgba(148, 163, 184, 0.32) !important;
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.94), rgba(30, 41, 59, 0.94)) !important;
}

:root[data-theme="dark"] button.resource-effect-overlay:not(.has-effect):hover:not(:disabled),
:root[data-theme="dark"] button.resource-effect-overlay:not(.has-effect):focus-visible,
:root[data-theme="dark"] .formation-picker-effect-btn:not(.has-effect):hover,
:root[data-theme="dark"] .formation-picker-effect-btn:not(.has-effect):focus-visible {
  border-color: rgba(148, 163, 184, 0.52) !important;
  background: linear-gradient(180deg, rgba(71, 85, 105, 0.96), rgba(51, 65, 85, 0.96)) !important;
}

:root[data-theme="dark"] .bottom-save-popover,
:root[data-theme="dark"] .bottom-global-popover {
  color: var(--ink);
}

:root[data-theme="dark"] .bottom-save-popover small,
:root[data-theme="dark"] .bottom-global-popover small,
:root[data-theme="dark"] .bottom-save-popover .state-status {
  color: rgba(226, 232, 240, 0.78);
}

:root[data-theme="dark"] .board-global-card {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--apostle-personality-color, #94a3b8) 68%, rgba(255, 255, 255, 0.24));
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--apostle-personality-color, #94a3b8) 36%, rgba(255, 255, 255, 0.12)),
      color-mix(in srgb, var(--apostle-personality-color, #94a3b8) 20%, rgba(15, 23, 42, 0.46)));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.14);
}

:root[data-theme="dark"] .board-global-card.personality-純粋 { --apostle-personality-color: var(--personality-pure); }
:root[data-theme="dark"] .board-global-card.personality-冷静 { --apostle-personality-color: var(--personality-calm); }
:root[data-theme="dark"] .board-global-card.personality-狂気 { --apostle-personality-color: var(--personality-madness); }
:root[data-theme="dark"] .board-global-card.personality-活発 { --apostle-personality-color: var(--personality-active); }
:root[data-theme="dark"] .board-global-card.personality-憂鬱 { --apostle-personality-color: var(--personality-gloomy); }

:root[data-theme="dark"] .board-global-apostle-link,
:root[data-theme="dark"] .board-global-apostle-link:hover:not(:disabled),
:root[data-theme="dark"] .board-global-apostle-link:focus-visible {
  color: inherit !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .board-global-apostle-icon {
  border-color: color-mix(in srgb, var(--apostle-personality-color, #94a3b8) 72%, rgba(255, 255, 255, 0.34));
  background:
    radial-gradient(circle at 50% 36%,
      color-mix(in srgb, var(--apostle-personality-color, #94a3b8) 42%, white),
      color-mix(in srgb, var(--apostle-personality-color, #94a3b8) 18%, transparent) 68%,
      transparent 74%);
}

:root[data-theme="dark"] .board-global-apostle-name {
  color: rgba(248, 250, 252, 0.94);
}

:root[data-theme="dark"] .board-global-apostle-traits {
  color: rgba(226, 232, 240, 0.72);
}

:root[data-theme="dark"] .board-global-apostle-progress-row {
  background: rgba(226, 232, 240, 0.15);
}

:root[data-theme="dark"] .board-global-apostle-progress-row.is-lower > span {
  background: #4ade80;
}

:root[data-theme="dark"] .board-global-apostle-progress-row.is-advanced > span {
  background: #60a5fa;
}

:root[data-theme="dark"] .board-global-apostle-progress-row.is-special > span {
  background: #c084fc;
}

:root[data-theme="dark"] .board-personal-progress {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.5);
}

:root[data-theme="dark"] .board-personal-progress-head strong,
:root[data-theme="dark"] .board-personal-effect-progress h3,
:root[data-theme="dark"] .board-personal-progress-ring strong,
:root[data-theme="dark"] .board-personal-effect-progress-label strong,
:root[data-theme="dark"] .board-personal-effect-progress-value strong {
  color: rgba(248, 250, 252, 0.94);
}

:root[data-theme="dark"] .board-personal-progress-head > div:first-child span,
:root[data-theme="dark"] .board-personal-progress-tabs {
  background: rgba(148, 163, 184, 0.12);
}

:root[data-theme="dark"] .board-personal-progress-tabs button {
  color: rgba(226, 232, 240, 0.68);
}

:root[data-theme="dark"] .board-personal-progress-tabs button.is-active {
  color: #f8fafc;
  background: rgba(71, 85, 105, 0.9);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .board-personal-progress-ring-item {
  background: rgba(148, 163, 184, 0.07);
}

:root[data-theme="dark"] .board-personal-progress-ring {
  --board-personal-ring-color: #4ade80;
  background: conic-gradient(var(--board-personal-ring-color) calc(var(--board-personal-progress) * 1%), rgba(148, 163, 184, 0.17) 0);
}

:root[data-theme="dark"] .board-personal-progress-ring-item.is-advanced .board-personal-progress-ring {
  --board-personal-ring-color: #60a5fa;
}

:root[data-theme="dark"] .board-personal-progress-ring-item.is-special .board-personal-progress-ring {
  --board-personal-ring-color: #c084fc;
}

:root[data-theme="dark"] .board-personal-progress-ring::before {
  background: #111c2d;
}

:root[data-theme="dark"] .board-personal-effect-progress-track {
  background: rgba(148, 163, 184, 0.16);
}

:root[data-theme="dark"] .board-personal-effect-progress-group {
  background: rgba(148, 163, 184, 0.06);
}

:root[data-theme="dark"] .board-personal-effect-progress-group.is-advanced {
  background: rgba(96, 165, 250, 0.08);
}

:root[data-theme="dark"] .board-personal-effect-progress-group.is-special {
  background: rgba(192, 132, 252, 0.08);
}

:root[data-theme="dark"] .board-personal-effect-progress-group-head strong {
  color: rgba(248, 250, 252, 0.92);
}

:root[data-theme="dark"] .board-current-summary,
:root[data-theme="dark"] .board-current-summary-empty {
  border-top-color: rgba(148, 163, 184, 0.16);
}

:root[data-theme="dark"] .board-global-card-head strong {
  color: #fde68a;
  background: rgba(15, 23, 42, 0.42);
}

:root[data-theme="dark"] .board-global-tiles {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  padding: 5px;
  background: rgba(8, 13, 18, 0.46);
}

:root[data-theme="dark"] .board-shortcut-group,
:root[data-theme="dark"] .board-global-change-panel,
:root[data-theme="dark"] .board-cost-summary,
:root[data-theme="dark"] .board-global-cost-summary {
  color: var(--ink);
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.42);
}

:root[data-theme="dark"] .board-shortcut-group.shortcut-layer-1 {
  border-color: rgba(74, 222, 128, 0.24);
  background: rgba(34, 197, 94, 0.16);
}

:root[data-theme="dark"] .board-shortcut-group.shortcut-layer-2 {
  border-color: rgba(96, 165, 250, 0.24);
  background: rgba(59, 130, 246, 0.16);
}

:root[data-theme="dark"] .board-shortcut-group.shortcut-layer-3 {
  border-color: rgba(196, 181, 253, 0.25);
  background: rgba(168, 85, 247, 0.17);
}

:root[data-theme="dark"] .board-stage {
  --board-frame: rgba(148, 163, 184, 0.22);
  --board-surface: rgba(15, 23, 42, 0.58);
  --board-tab: rgba(30, 41, 59, 0.92);
  --board-arrow: rgba(30, 41, 59, 0.86);
  --board-accent-text: #e2e8f0;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .board-stage.board-layer-1 {
  --board-frame: rgba(74, 222, 128, 0.38);
  --board-surface: rgba(34, 197, 94, 0.24);
  --board-tab: rgba(34, 197, 94, 0.32);
  --board-arrow: rgba(34, 197, 94, 0.28);
  --board-accent-text: #bbf7d0;
}

:root[data-theme="dark"] .board-stage.board-layer-2 {
  --board-frame: rgba(96, 165, 250, 0.38);
  --board-surface: rgba(59, 130, 246, 0.24);
  --board-tab: rgba(59, 130, 246, 0.32);
  --board-arrow: rgba(59, 130, 246, 0.28);
  --board-accent-text: #bfdbfe;
}

:root[data-theme="dark"] .board-stage.board-layer-3 {
  --board-frame: rgba(196, 181, 253, 0.4);
  --board-surface: rgba(168, 85, 247, 0.26);
  --board-tab: rgba(168, 85, 247, 0.34);
  --board-arrow: rgba(168, 85, 247, 0.3);
  --board-accent-text: #e9d5ff;
}

:root[data-theme="dark"] .board-shortcut-title,
:root[data-theme="dark"] .board-shortcut-rate,
:root[data-theme="dark"] .board-global-no-change,
:root[data-theme="dark"] .board-global-cost-empty,
:root[data-theme="dark"] .board-effect-empty td {
  color: rgba(226, 232, 240, 0.76);
}

:root[data-theme="dark"] .board-global-change-head,
:root[data-theme="dark"] .board-draft-head {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.14);
}

:root[data-theme="dark"] .board-global-summary-actions button,
:root[data-theme="dark"] .board-global-actions button,
:root[data-theme="dark"] .board-draft-actions button {
  color: #ddd6fe;
  border-color: rgba(196, 181, 253, 0.24);
  background: rgba(30, 41, 59, 0.78);
}

:root[data-theme="dark"] .board-global-summary-actions button.primary,
:root[data-theme="dark"] .board-global-actions button.primary {
  color: #ffffff;
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(37, 99, 235, 0.82);
}

:root[data-theme="dark"] .board-global-summary-actions button.plan,
:root[data-theme="dark"] .board-global-actions button.plan {
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.32);
  background: rgba(22, 163, 74, 0.16);
}

:root[data-theme="dark"] .board-global-discard-plan {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(127, 29, 29, 0.32);
}

:root[data-theme="dark"] .board-global-discard-plan:hover:not(:disabled) {
  color: #ffffff;
  border-color: rgba(252, 165, 165, 0.58);
  background: rgba(153, 27, 27, 0.58);
}

:root[data-theme="dark"] .board-global-floating-dock {
  color: var(--ink);
  border-color: rgba(226, 232, 240, 0.5);
  background: rgba(15, 23, 42, 0.92);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .board-global-floating-panel,
:root[data-theme="dark"] .board-global-floating-save-panel {
  color: var(--ink);
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.9);
}

:root[data-theme="dark"] .board-global-floating-panel .summary-table-grid,
:root[data-theme="dark"] .board-global-floating-panel .rank-summary-tables {
  background: transparent !important;
}

:root[data-theme="dark"] .board-global-floating-panel .board-change-section {
  color: rgba(238, 247, 242, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(7, 12, 18, 0.34) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .board-global-floating-panel .board-draft-head {
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.14);
  background: rgba(34, 197, 94, 0.12) !important;
}

:root[data-theme="dark"] .board-global-floating-panel .board-draft-title strong {
  color: #f8fafc;
  background: transparent !important;
}

:root[data-theme="dark"] .board-global-floating-panel .board-plan-saved,
:root[data-theme="dark"] .board-global-floating-panel .board-plan-unsaved {
  color: #e0f2fe;
  border-color: rgba(125, 211, 252, 0.22);
  background: rgba(14, 116, 144, 0.18) !important;
}

:root[data-theme="dark"] .board-global-floating-panel .board-global-cost-summary {
  color: rgba(226, 232, 240, 0.92);
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(8, 13, 24, 0.48);
}

:root[data-theme="dark"] .board-global-floating-panel .board-global-cost-chip {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(30, 41, 59, 0.76);
  box-shadow: none;
}

:root[data-theme="dark"] .board-global-floating-panel .board-global-cost-chip strong {
  color: #bbf7d0;
  background: transparent !important;
}

:root[data-theme="dark"] .board-global-floating-panel .board-global-cost-chip.is-negative strong {
  color: #fecaca;
}

:root[data-theme="dark"] .board-global-floating-panel .board-global-change-matrix,
:root[data-theme="dark"] .board-global-floating-panel .board-draft-change-matrix {
  --board-global-layer-border: rgba(148, 163, 184, 0.22);
  --board-global-layer-bg: rgba(8, 13, 24, 0.52);
  --board-global-layer-label-bg: rgba(51, 65, 85, 0.84);
  --board-global-layer-text: rgba(226, 232, 240, 0.94);
  color: rgba(226, 232, 240, 0.92);
  border-color: rgba(148, 163, 184, 0.2) !important;
  background-color: rgba(8, 13, 24, 0.52) !important;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 44%) !important;
}

:root[data-theme="dark"] .board-global-floating-panel .board-global-change-matrix thead th,
:root[data-theme="dark"] .board-global-floating-panel .board-draft-change-matrix thead th {
  color: #f8fafc !important;
  background: rgba(51, 65, 85, 0.86) !important;
}

:root[data-theme="dark"] .board-global-floating-panel .board-global-change-matrix tbody th,
:root[data-theme="dark"] .board-global-floating-panel .board-draft-change-matrix tbody th {
  color: #c4b5fd;
  background: rgba(15, 23, 42, 0.28) !important;
}

:root[data-theme="dark"] .board-global-floating-panel .board-global-change-matrix td,
:root[data-theme="dark"] .board-global-floating-panel .board-draft-change-matrix td {
  color: rgba(241, 245, 249, 0.92);
  background: rgba(15, 23, 42, 0.18);
}

:root[data-theme="dark"] .board-global-floating-panel .board-global-change-matrix td strong,
:root[data-theme="dark"] .board-global-floating-panel .board-draft-change-matrix td strong {
  color: #fde68a;
  background: transparent !important;
}

:root[data-theme="dark"] .board-global-floating-mode {
  border-color: rgba(226, 232, 240, 0.36);
  background: rgba(2, 8, 23, 0.78);
}

:root[data-theme="dark"] .board-global-floating-mode button {
  color: rgba(226, 232, 240, 0.72);
  background: transparent;
}

:root[data-theme="dark"] .board-global-floating-mode button.is-active {
  color: #ffffff;
  background: rgba(37, 99, 235, 0.86);
}

:root[data-theme="dark"] .board-shortcut-off-toggle {
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(20, 83, 45, 0.46);
  box-shadow: none;
}

:root[data-theme="dark"] .board-shortcut-off-toggle.is-route {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.32);
  background: rgba(30, 64, 175, 0.42);
}

:root[data-theme="dark"] .board-global-layer {
  border-color: var(--board-global-layer-border);
  background: var(--board-global-layer-bg);
}

:root[data-theme="dark"] .board-global-layer-label {
  color: #f8fafc;
  border: 1px solid color-mix(in srgb, var(--board-global-layer-label-bg) 72%, rgba(255, 255, 255, 0.34));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 46%),
    var(--board-global-layer-label-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 2px 7px rgba(0, 0, 0, 0.24);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .board-global-layer-1 {
  --board-global-layer-border: rgba(74, 222, 128, 0.28);
  --board-global-layer-bg: rgba(34, 197, 94, 0.16);
  --board-global-layer-label-bg: rgba(22, 163, 74, 0.86);
}

:root[data-theme="dark"] .board-global-layer-2 {
  --board-global-layer-border: rgba(96, 165, 250, 0.28);
  --board-global-layer-bg: rgba(59, 130, 246, 0.16);
  --board-global-layer-label-bg: rgba(37, 99, 235, 0.86);
}

:root[data-theme="dark"] .board-global-layer-3 {
  --board-global-layer-border: rgba(196, 181, 253, 0.3);
  --board-global-layer-bg: rgba(168, 85, 247, 0.18);
  --board-global-layer-label-bg: rgba(126, 34, 206, 0.86);
}

:root[data-theme="dark"] .board-global-ratio,
:root[data-theme="dark"] .board-global-stat-matrix {
  --board-global-layer-border: rgba(148, 163, 184, 0.2);
  --board-global-layer-bg: rgba(15, 23, 42, 0.42);
  --board-global-layer-label-bg: rgba(71, 85, 105, 0.78);
  --board-global-layer-text: rgba(238, 247, 242, 0.94);
}

:root[data-theme="dark"] .board-global-ratio-layer-1,
:root[data-theme="dark"] .board-global-stat-matrix-1 {
  --board-global-layer-border: rgba(74, 222, 128, 0.34);
  --board-global-layer-bg: #102f24;
  --board-global-layer-label-bg: rgba(22, 163, 74, 0.84);
  --board-global-layer-text: #bbf7d0;
}

:root[data-theme="dark"] .board-global-ratio-layer-2,
:root[data-theme="dark"] .board-global-stat-matrix-2 {
  --board-global-layer-border: rgba(96, 165, 250, 0.34);
  --board-global-layer-bg: #17294f;
  --board-global-layer-label-bg: rgba(37, 99, 235, 0.84);
  --board-global-layer-text: #bfdbfe;
}

:root[data-theme="dark"] .board-global-ratio-layer-3,
:root[data-theme="dark"] .board-global-stat-matrix-3 {
  --board-global-layer-border: rgba(196, 181, 253, 0.36);
  --board-global-layer-bg: #321d4c;
  --board-global-layer-label-bg: rgba(126, 34, 206, 0.86);
  --board-global-layer-text: #e9d5ff;
}

:root[data-theme="dark"] .board-global-ratio {
  color: var(--board-global-layer-text);
  border: 1px solid var(--board-global-layer-border);
  background-color: var(--board-global-layer-bg) !important;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 46%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

:root[data-theme="dark"] .board-global-ratio span {
  color: #f8fafc;
  background: transparent !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.38);
}

:root[data-theme="dark"] .board-global-ratio strong,
:root[data-theme="dark"] .board-global-ratio small {
  color: var(--board-global-layer-text);
}

.board-global-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

:root[data-theme="dark"] .board-global-effect-type-matrix.is-special {
  --board-global-layer-border: rgba(196, 181, 253, 0.36);
  --board-global-layer-bg: #321d4c;
  --board-global-layer-label-bg: rgba(126, 34, 206, 0.86);
  --board-global-layer-text: #e9d5ff;
}

:root[data-theme="dark"] .board-global-effect-type-matrix.is-advanced {
  --board-global-layer-border: rgba(96, 165, 250, 0.34);
  --board-global-layer-bg: #17294f;
  --board-global-layer-label-bg: rgba(37, 99, 235, 0.84);
  --board-global-layer-text: #bfdbfe;
}

:root[data-theme="dark"] button.board-floating-cancel-button {
  color: #fff;
  border-color: rgba(252, 165, 165, 0.48);
  background: #a83f49;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.24),
    0 4px 10px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] button.board-floating-cancel-button:disabled {
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(252, 165, 165, 0.48);
  background: #a83f49;
  opacity: 0.72;
}

.card-manager-bulk-menu {
  position: relative;
  z-index: 8;
}

.card-manager-bulk-menu[open] {
  z-index: 30;
}

.card-manager-bulk-menu > summary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid rgba(91, 83, 177, 0.38);
  border-radius: 999px;
  padding: 0 14px;
  color: #514a9b;
  background: linear-gradient(135deg, rgba(229, 226, 255, 0.96), rgba(207, 218, 255, 0.9));
  box-shadow: 0 4px 12px rgba(84, 74, 160, 0.14);
  font-size: 0.76rem;
  font-weight: 950;
  cursor: pointer;
  list-style: none;
}

.card-manager-bulk-menu > summary::-webkit-details-marker {
  display: none;
}

.card-manager-bulk-menu > summary::before {
  content: "✦";
  margin-right: 5px;
  font-size: 0.72rem;
}

.card-manager-bulk-menu[open] > summary {
  color: #fff;
  border-color: #6358b7;
  background: linear-gradient(135deg, #786bc9, #514a9b);
}

.card-manager-bulk-popover {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 40;
  width: min(300px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  box-sizing: border-box;
  border: 1px solid rgba(91, 83, 177, 0.28);
  border-radius: 15px;
  padding: 10px;
  color: var(--ink);
  background: rgba(255, 253, 250, 0.98);
  box-shadow: 0 18px 40px rgba(46, 40, 100, 0.24);
  backdrop-filter: blur(10px);
}

.card-manager-bulk-popover p,
.card-manager-bulk-popover > button {
  grid-column: 1 / -1;
}

.card-manager-bulk-popover p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.45;
}

.card-manager-bulk-popover > button {
  min-height: 34px;
  border: 1px solid rgba(91, 83, 177, 0.28);
  border-radius: 10px;
  color: #514a9b;
  background: rgba(229, 226, 255, 0.76);
  font-size: 0.74rem;
  font-weight: 950;
  cursor: pointer;
}

.card-manager-bulk-popover .card-manager-select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-color: rgba(91, 83, 177, 0.24);
  background: rgba(235, 233, 255, 0.72);
}

:root[data-theme="dark"] .card-manager-bulk-menu > summary {
  color: #ddd6fe;
  border-color: rgba(167, 139, 250, 0.5);
  background: linear-gradient(135deg, rgba(91, 76, 166, 0.62), rgba(55, 48, 112, 0.72));
}

:root[data-theme="dark"] .card-manager-bulk-menu[open] > summary {
  color: #fff;
  background: linear-gradient(135deg, #7c6fd0, #574aa7);
}

:root[data-theme="dark"] .card-manager-bulk-popover {
  color: rgba(248, 250, 252, 0.96);
  border-color: rgba(167, 139, 250, 0.34);
  background: rgba(17, 24, 39, 0.98);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5);
}

:root[data-theme="dark"] .card-manager-bulk-popover > button,
:root[data-theme="dark"] .card-manager-bulk-popover .card-manager-select {
  color: rgba(245, 243, 255, 0.96) !important;
  border-color: rgba(167, 139, 250, 0.34) !important;
  background: rgba(76, 65, 137, 0.5) !important;
}

@media (max-width: 520px) {
  .card-manager-bulk-menu {
    grid-column: 1 / -1;
  }

  .card-manager-bulk-menu > summary {
    width: 100%;
  }

  .card-manager-bulk-popover {
    right: 0;
    left: 0;
    width: auto;
  }
}

.board-global-intro .panel-note {
  min-width: min(100%, 420px);
  flex: 1 1 520px;
  margin: 0;
}

.board-preview-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  border: 1px solid rgba(36, 83, 59, 0.24);
  border-radius: 10px;
  padding: 0 12px;
  color: var(--green-dark);
  background: var(--paper-strong);
  box-shadow: 0 3px 10px rgba(27, 57, 39, 0.07);
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.board-preview-link span {
  font-size: 1rem;
  line-height: 1;
}

.board-preview-link:hover,
.board-preview-link:focus-visible {
  border-color: rgba(36, 83, 59, 0.46);
  background: color-mix(in srgb, var(--paper-strong) 82%, #dff4e6 18%);
  transform: translateY(-1px);
}

:root[data-theme="dark"] .board-preview-link {
  color: #dff4e6;
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(15, 28, 41, 0.9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .board-preview-link:hover,
:root[data-theme="dark"] .board-preview-link:focus-visible {
  border-color: rgba(134, 239, 172, 0.42);
  background: rgba(25, 48, 57, 0.96);
}

.board-global-query-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 6px 8px;
  margin: 6px 0 4px;
}

.board-global-query-tools label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.board-global-query-tools label span {
  flex: 0 0 auto;
  font-size: 0.74rem;
  font-weight: 900;
}

.board-global-search input {
  width: min(260px, 42vw);
}

.board-global-filter-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
  margin: 4px 0 8px;
  border: 0;
  padding: 0;
  background: transparent;
}

.board-global-filter-heading {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: rgba(50, 76, 58, 0.78);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.board-global-filter-count {
  display: none;
}

.board-global-filters {
  display: contents;
}

.board-global-filter-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.board-global-filter-row strong {
  color: rgba(50, 76, 58, 0.74);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.board-global-filters button {
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.board-global-stat-filter-row button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  min-width: 30px;
  height: 28px;
  padding: 1px;
}

.board-global-stat-filter-row button img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.board-global-bottom-summary {
  margin: 12px 0 4px;
}

.board-global-stat-summary {
  border: 1px solid rgba(74, 136, 90, 0.18);
  border-radius: 16px;
  padding: 10px;
  background: linear-gradient(135deg, rgba(248, 253, 249, 0.94), rgba(239, 248, 242, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 8px 18px rgba(36, 74, 47, 0.08);
}

.board-global-stat-summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  margin-bottom: 8px;
}

.board-global-stat-summary-head strong {
  color: #235332;
  font-size: 0.9rem;
  font-weight: 950;
}

.board-global-stat-summary-head span {
  color: rgba(43, 74, 53, 0.76);
  font-size: 0.76rem;
  font-weight: 900;
}

.board-global-stat-summary-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.board-global-stat-summary-counts span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  border: 1px solid rgba(74, 136, 90, 0.16);
  border-radius: 999px;
  padding: 2px 8px;
  color: rgba(36, 74, 47, 0.84);
  background: rgba(255, 255, 255, 0.66);
  font-size: 0.75rem;
  font-weight: 900;
}

.board-global-stat-summary-counts img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.board-global-stat-summary-grid {
  align-items: stretch;
}

:root[data-theme="dark"] .board-global-filter-row strong {
  color: rgba(232, 244, 237, 0.92) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

:root[data-theme="dark"] .board-global-filter-heading {
  color: rgba(250, 255, 252, 0.9) !important;
  background: transparent !important;
}

:root[data-theme="dark"] .board-global-stat-filter-row button img {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

:root[data-theme="dark"] .board-global-stat-summary {
  color: var(--ink);
  border-color: rgba(74, 222, 128, 0.16);
  background: linear-gradient(135deg, rgba(12, 28, 24, 0.82), rgba(12, 20, 34, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 24px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .board-global-stat-summary-head strong {
  color: rgba(248, 250, 252, 0.96);
}

:root[data-theme="dark"] .board-global-stat-summary-head span {
  color: rgba(226, 232, 240, 0.78);
}

:root[data-theme="dark"] .board-global-stat-summary-counts span {
  color: rgba(238, 247, 242, 0.92);
  border-color: rgba(74, 222, 128, 0.16);
  background: rgba(7, 12, 18, 0.34);
}

:root[data-theme="dark"] .board-global-stat-summary-counts img {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

@media (max-width: 700px) {
  .board-global-query-tools {
    gap: 5px;
  }

  .board-global-search input {
    width: min(210px, 58vw);
  }


  .board-global-filters {
    gap: 4px 6px;
  }
}

:root[data-theme="dark"] .board-global-stat-matrix {
  border-color: var(--board-global-layer-border) !important;
  background-color: var(--board-global-layer-bg) !important;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 38%) !important;
}

:root[data-theme="dark"] .board-global-stat-matrix thead th {
  color: #f8fafc !important;
  background: color-mix(in srgb, var(--board-global-layer-label-bg) 72%, rgba(15, 23, 42, 0.55)) !important;
}

:root[data-theme="dark"] .board-global-stat-matrix tbody th {
  background: rgba(15, 23, 42, 0.28);
}

:root[data-theme="dark"] .board-global-stat-matrix td strong {
  color: var(--board-global-layer-text);
  background: transparent !important;
}

:root[data-theme="dark"] .board-global-special-value small {
  color: color-mix(in srgb, var(--board-global-layer-text) 70%, rgba(226, 232, 240, 0.7));
}

:root[data-theme="dark"] .board-global-count-current {
  color: #fde68a;
}

:root[data-theme="dark"] .board-global-count-separator,
:root[data-theme="dark"] .board-global-count-total {
  color: rgba(203, 213, 225, 0.72);
}

:root[data-theme="dark"] .board-global-special-value small.is-complete {
  color: rgba(207, 250, 254, 0.92);
  background: rgba(14, 116, 144, 0.2);
  box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.25);
}

:root[data-theme="dark"] .board-global-special-value small.is-complete::before {
  color: #ecfeff;
  background: #287f99;
}

:root[data-theme="dark"] .board-global-tile,
:root[data-theme="dark"] .board-global-tile:hover:not(:disabled),
:root[data-theme="dark"] .board-global-tile:focus-visible {
  border-color: transparent;
  background-color: transparent;
  background-image: var(--tile-base);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

:root[data-theme="dark"] .board-global-tile img {
  background: transparent;
}

:root[data-theme="dark"] .rank-overview-card[class*="personality-"] {
  color: rgba(248, 250, 252, 0.95);
  border-color: color-mix(in srgb, var(--overview-personality-color) 70%, rgba(255, 255, 255, 0.28));
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--overview-personality-color) 42%, rgba(255, 255, 255, 0.1)),
      color-mix(in srgb, var(--overview-personality-color) 24%, rgba(15, 23, 42, 0.42))) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.14), 0 6px 16px rgba(0, 0, 0, 0.16);
}

:root[data-theme="dark"] .rank-overview-card[class*="personality-"].rank-gold,
:root[data-theme="dark"] .rank-overview-card[class*="personality-"].aside-a3 {
  background:
    linear-gradient(135deg, rgba(253, 230, 138, 0.32), transparent 58%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--overview-personality-color) 42%, rgba(255, 255, 255, 0.1)),
      color-mix(in srgb, var(--overview-personality-color) 24%, rgba(15, 23, 42, 0.42))) !important;
}

:root[data-theme="dark"] .rank-overview-card[class*="personality-"].rank-purple,
:root[data-theme="dark"] .rank-overview-card[class*="personality-"].aside-a2 {
  background:
    linear-gradient(135deg, rgba(216, 180, 254, 0.24), transparent 58%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--overview-personality-color) 42%, rgba(255, 255, 255, 0.1)),
      color-mix(in srgb, var(--overview-personality-color) 24%, rgba(15, 23, 42, 0.42))) !important;
}

:root[data-theme="dark"] .rank-overview-card[class*="personality-"].rank-blue,
:root[data-theme="dark"] .rank-overview-card[class*="personality-"].aside-a1 {
  background:
    linear-gradient(135deg, rgba(147, 197, 253, 0.24), transparent 58%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--overview-personality-color) 42%, rgba(255, 255, 255, 0.1)),
      color-mix(in srgb, var(--overview-personality-color) 24%, rgba(15, 23, 42, 0.42))) !important;
}

:root[data-theme="dark"] .rank-overview-card[class*="personality-"].rank-green {
  background:
    linear-gradient(135deg, rgba(134, 239, 172, 0.22), transparent 58%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--overview-personality-color) 42%, rgba(255, 255, 255, 0.1)),
      color-mix(in srgb, var(--overview-personality-color) 24%, rgba(15, 23, 42, 0.42))) !important;
}

:root[data-theme="dark"] .rank-overview-card[class*="personality-"] .rank-overview-name {
  color: rgba(248, 250, 252, 0.96);
}

:root[data-theme="dark"] .rank-overview-card[class*="personality-"] .rank-overview-value {
  color: rgba(255, 247, 214, 0.94);
}

:root[data-theme="dark"] .rank-overview-card[class*="personality-"] .rank-overview-icon {
  background:
    radial-gradient(circle at 50% 36%,
      color-mix(in srgb, var(--overview-personality-color) 40%, white),
      color-mix(in srgb, var(--overview-personality-color) 18%, transparent) 68%,
      transparent 74%);
}

.dashboard-bottom-bar .bottom-theme-toggle,
.dashboard-bottom-bar .bottom-theme-toggle:hover,
.dashboard-bottom-bar .bottom-theme-toggle:focus-visible,
:root[data-theme="dark"] .dashboard-bottom-bar .bottom-theme-toggle,
:root[data-theme="dark"] .dashboard-bottom-bar .bottom-theme-toggle:hover,
:root[data-theme="dark"] .dashboard-bottom-bar .bottom-theme-toggle:focus-visible {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  flex: 0 0 34px !important;
  margin-left: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] button.board-node,
:root[data-theme="dark"] button.board-shortcut,
:root[data-theme="dark"] button.board-global-tile {
  border-color: transparent !important;
  background-color: transparent !important;
  background-image: var(--tile-base) !important;
  background-repeat: no-repeat;
  background-position: center !important;
  background-size: contain !important;
  box-shadow: none;
}

:root[data-theme="dark"] button.board-node:hover:not(:disabled),
:root[data-theme="dark"] button.board-shortcut:hover:not(:disabled),
:root[data-theme="dark"] button.board-global-tile:hover:not(:disabled),
:root[data-theme="dark"] button.board-node:focus-visible,
:root[data-theme="dark"] button.board-shortcut:focus-visible,
:root[data-theme="dark"] button.board-global-tile:focus-visible {
  background-color: transparent !important;
  background-image: var(--tile-base) !important;
}

:root[data-theme="dark"] button.board-node.is-empty,
:root[data-theme="dark"] button.board-node.is-empty:hover:not(:disabled),
:root[data-theme="dark"] button.board-node.is-empty:focus-visible {
  background: transparent !important;
}

:root[data-theme="dark"] .resource-grade-btn,
:root[data-theme="dark"] .resource-grade-btn:hover:not(:disabled),
:root[data-theme="dark"] .resource-grade-btn:focus-visible,
:root[data-theme="dark"] .resource-solder-overlay,
:root[data-theme="dark"] .resource-solder-overlay:hover:not(:disabled),
:root[data-theme="dark"] .resource-solder-overlay:focus-visible,
:root[data-theme="dark"] .formation-apostle-slot,
:root[data-theme="dark"] .formation-apostle-slot:hover:not(:disabled),
:root[data-theme="dark"] .formation-artifact-slot,
:root[data-theme="dark"] .formation-artifact-slot:hover:not(:disabled),
:root[data-theme="dark"] .formation-spell-selected-card,
:root[data-theme="dark"] .formation-spell-selected-card:hover:not(:disabled) {
  background-color: transparent !important;
  background-image: none !important;
}

:root[data-theme="dark"] .resource-grade-btn img,
:root[data-theme="dark"] .resource-solder-token-icon,
:root[data-theme="dark"] .formation-apostle-img,
:root[data-theme="dark"] .formation-artifact-img,
:root[data-theme="dark"] .formation-slot-bg {
  background: transparent !important;
}

:root[data-theme="dark"] .resource-card-mobile-controls select {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(30, 41, 59, 0.94);
}

:root[data-theme="dark"] .resource-card-mobile-controls select:disabled {
  color: rgba(226, 232, 240, 0.44);
  background: rgba(15, 23, 42, 0.76);
}

:root[data-theme="dark"] .resource-solder-overlay[data-card-solder-overlay][aria-label="はんだ+2"]:not(.is-disabled) .resource-solder-token-value {
  color: #c026d3;
  text-shadow: none;
}

:root[data-theme="dark"] .apostle-picker-current-image,
:root[data-theme="dark"] .apostle-picker-card-image,
:root[data-theme="dark"] .formation-picker-option-image-wrap,
:root[data-theme="dark"] .rank-overview-icon,
:root[data-theme="dark"] .equipment-center-portrait,
:root[data-theme="dark"] .portrait-frame {
  background-color: transparent;
}

:root[data-theme="dark"] .apostle-picker-current-image img,
:root[data-theme="dark"] .apostle-picker-card-image img,
:root[data-theme="dark"] .formation-picker-option-image-wrap img,
:root[data-theme="dark"] .rank-overview-icon img,
:root[data-theme="dark"] .equipment-center-portrait img,
:root[data-theme="dark"] .portrait-frame img {
  background: transparent !important;
}

.apostle-picker-card.personality-純粋 { --apostle-personality-color: var(--personality-pure); }
.apostle-picker-card.personality-冷静 { --apostle-personality-color: var(--personality-calm); }
.apostle-picker-card.personality-狂気 { --apostle-personality-color: var(--personality-madness); }
.apostle-picker-card.personality-活発 { --apostle-personality-color: var(--personality-active); }
.apostle-picker-card.personality-憂鬱 { --apostle-personality-color: var(--personality-gloomy); }

button.apostle-picker-card[class*="personality-"] {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--apostle-personality-color) 68%, rgba(255, 255, 255, 0.5)) !important;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--apostle-personality-color) 28%, rgba(255, 255, 255, 0.9)),
      color-mix(in srgb, var(--apostle-personality-color) 12%, rgba(255, 255, 255, 0.96))) !important;
  box-shadow:
    0 6px 14px color-mix(in srgb, var(--apostle-personality-color) 22%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

button.apostle-picker-card[class*="personality-"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  height: 40px;
  background: #fff;
  pointer-events: none;
}

button.apostle-picker-card[class*="personality-"].is-selected {
  border-color: color-mix(in srgb, var(--apostle-personality-color) 86%, white) !important;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--apostle-personality-color) 26%, transparent),
    0 8px 18px color-mix(in srgb, var(--apostle-personality-color) 24%, transparent);
}

button.apostle-picker-card[class*="personality-"] .apostle-picker-art {
  border-color: color-mix(in srgb, var(--apostle-personality-color) 70%, white) !important;
  background: color-mix(in srgb, var(--apostle-personality-color) 22%, white) !important;
}

button.apostle-picker-card[class*="personality-"] > strong {
  position: relative;
  z-index: 2;
  display: block;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  margin: -2px 0 -7px;
  padding: 0 6px 8px;
  color: #1f2933 !important;
  background: transparent !important;
  border-radius: 0 0 12px 12px;
  text-shadow: none !important;
}

button.apostle-picker-card[class*="personality-"] .apostle-picker-stars {
  z-index: 3;
  transform: translateY(-8px);
  margin-bottom: -5px;
}

:root[data-theme="dark"] button.apostle-picker-card[class*="personality-"] {
  color: #1f2933 !important;
  border-color: color-mix(in srgb, var(--apostle-personality-color) 78%, rgba(255, 255, 255, 0.35)) !important;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--apostle-personality-color) 30%, rgba(235, 240, 245, 0.9)),
      color-mix(in srgb, var(--apostle-personality-color) 10%, rgba(244, 247, 250, 0.94))) !important;
}

:root[data-theme="dark"] button.apostle-picker-card[class*="personality-"] .apostle-picker-art {
  border-color: color-mix(in srgb, var(--apostle-personality-color) 72%, rgba(255, 255, 255, 0.58)) !important;
  background: color-mix(in srgb, var(--apostle-personality-color) 34%, white) !important;
}

:root[data-theme="dark"] button.apostle-picker-card[class*="personality-"] > strong {
  position: relative;
  z-index: 2;
  display: block;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  margin: -2px 0 -7px;
  padding: 0 6px 8px;
  color: #1f2933 !important;
  background: transparent !important;
  border-radius: 0 0 12px 12px;
  text-shadow: none !important;
}

:root[data-theme="dark"] button.apostle-picker-card[class*="personality-"] .apostle-picker-stars {
  z-index: 3;
  transform: translateY(-8px);
  margin-bottom: -5px;
}

button.apostle-picker-card[class*="personality-"] > strong.has-sort-value,
:root[data-theme="dark"] button.apostle-picker-card[class*="personality-"] > strong.has-sort-value {
  margin-top: -5px;
  padding-bottom: 7px;
  line-height: 0.98;
}

button.apostle-picker-card[class*="personality-"] > strong.has-sort-value .apostle-picker-sort-value {
  color: rgba(31, 41, 51, 0.72);
}
/* Dark-mode specific apostle info chips: readable, but not the light palette. */
:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-chip,
:root[data-theme="dark"] .dashboard-persistent-profile .profile-skill-levels label {
  color-scheme: dark !important;
  border-color: rgba(190, 215, 190, 0.24) !important;
  background: rgba(31, 45, 38, 0.9) !important;
  color: rgba(239, 247, 238, 0.95) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.24) !important;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-chip small {
  color: rgba(213, 229, 212, 0.72) !important;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-chip strong {
  color: rgba(250, 255, 248, 0.98) !important;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-select,
:root[data-theme="dark"] .dashboard-persistent-profile .profile-skill-levels select {
  color-scheme: dark !important;
  border-color: rgba(220, 238, 220, 0.18) !important;
  background: rgba(12, 21, 18, 0.52) !important;
  color: rgba(250, 255, 248, 0.98) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28) !important;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-select option,
:root[data-theme="dark"] .dashboard-persistent-profile .profile-skill-levels select option {
  color: rgba(250, 255, 248, 0.98) !important;
  background: #17211c !important;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-select:focus,
:root[data-theme="dark"] .dashboard-persistent-profile .profile-skill-levels select:focus {
  border-color: rgba(134, 239, 172, 0.72) !important;
  outline: 2px solid rgba(134, 239, 172, 0.28) !important;
  outline-offset: 1px !important;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-chip-level {
  border-color: rgba(134, 239, 172, 0.28) !important;
  background: linear-gradient(135deg, rgba(21, 86, 50, 0.9), rgba(24, 51, 39, 0.9)) !important;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-chip-rank {
  border-color: rgba(147, 197, 253, 0.28) !important;
  background: linear-gradient(135deg, rgba(31, 78, 132, 0.9), rgba(28, 45, 70, 0.9)) !important;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-chip-bond {
  border-color: rgba(244, 114, 182, 0.3) !important;
  background: linear-gradient(135deg, rgba(130, 46, 88, 0.9), rgba(62, 34, 50, 0.9)) !important;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-chip-aside,
:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-chip-aside-level {
  border-color: rgba(251, 191, 36, 0.3) !important;
  background: linear-gradient(135deg, rgba(123, 83, 20, 0.9), rgba(58, 45, 25, 0.9)) !important;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-chip-skill,
:root[data-theme="dark"] .dashboard-persistent-profile .profile-skill-levels label {
  border-color: rgba(196, 181, 253, 0.28) !important;
  background: linear-gradient(135deg, rgba(81, 60, 138, 0.9), rgba(45, 39, 72, 0.9)) !important;
  color: rgba(248, 247, 255, 0.96) !important;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-chip-equipment {
  border-color: rgba(126, 177, 190, 0.3) !important;
  background: linear-gradient(135deg, rgba(35, 65, 72, 0.96), rgba(35, 52, 56, 0.96)) !important;
  color: rgba(235, 246, 246, 0.96) !important;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-chip-equipment > small,
:root[data-theme="dark"] .dashboard-persistent-profile .profile-equipment-chip small {
  color: rgba(205, 226, 227, 0.76) !important;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-equipment-chip {
  color: rgba(235, 246, 246, 0.96);
  background: rgba(142, 189, 197, 0.1);
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-equipment-chip select {
  color-scheme: dark;
  color: rgba(239, 248, 248, 0.98);
  background: rgba(126, 174, 184, 0.14);
  box-shadow: inset 0 0 0 1px rgba(174, 211, 217, 0.08);
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-equipment-chip select option {
  color: rgba(239, 248, 248, 0.98);
  background: #263b3f;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-meta-chip-follow {
  border-color: rgba(251, 146, 60, 0.3) !important;
  background: linear-gradient(135deg, rgba(132, 72, 26, 0.9), rgba(62, 40, 28, 0.9)) !important;
}

:root[data-theme="dark"] .dashboard-persistent-profile .profile-skill-levels label > span,
:root[data-theme="dark"] .dashboard-persistent-profile .profile-skill-levels label select {
  color: rgba(248, 247, 255, 0.96) !important;
}

/* Global setting cards use progress/rank tones, not personality tones. */
.rank-overview-card[class*="personality-"] {
  border-color: rgba(44, 88, 59, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

.rank-overview-card[class*="personality-"].rank-gold,
.rank-overview-card[class*="personality-"].aside-a3 {
  border-color: rgba(202, 138, 4, 0.22);
  background: linear-gradient(135deg, rgba(255, 239, 166, 0.64), rgba(255, 255, 255, 0.74));
}

.rank-overview-card[class*="personality-"].rank-purple,
.rank-overview-card[class*="personality-"].aside-a2 {
  border-color: rgba(147, 51, 234, 0.18);
  background: linear-gradient(135deg, rgba(216, 190, 255, 0.5), rgba(255, 255, 255, 0.74));
}

.rank-overview-card[class*="personality-"].rank-blue,
.rank-overview-card[class*="personality-"].aside-a1 {
  border-color: rgba(37, 99, 235, 0.16);
  background: linear-gradient(135deg, rgba(186, 221, 255, 0.5), rgba(255, 255, 255, 0.74));
}

.rank-overview-card[class*="personality-"].rank-green {
  border-color: rgba(22, 163, 74, 0.16);
  background: linear-gradient(135deg, rgba(193, 236, 192, 0.48), rgba(255, 255, 255, 0.74));
}

:root[data-theme="dark"] .rank-overview-card[class*="personality-"] {
  color: rgba(248, 250, 252, 0.95);
  border-color: rgba(177, 190, 210, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%),
    rgba(44, 55, 70, 0.96) !important;
}

:root[data-theme="dark"] .rank-overview-card[class*="personality-"].rank-gold,
:root[data-theme="dark"] .rank-overview-card[class*="personality-"].aside-a3 {
  border-color: rgba(238, 195, 82, 0.46);
  background:
    linear-gradient(180deg, rgba(255, 246, 203, 0.12), transparent 42%),
    rgba(90, 68, 30, 0.96) !important;
}

:root[data-theme="dark"] .rank-overview-card[class*="personality-"].rank-purple,
:root[data-theme="dark"] .rank-overview-card[class*="personality-"].aside-a2 {
  border-color: rgba(185, 154, 236, 0.46);
  background:
    linear-gradient(180deg, rgba(236, 226, 255, 0.12), transparent 42%),
    rgba(67, 51, 96, 0.96) !important;
}

:root[data-theme="dark"] .rank-overview-card[class*="personality-"].rank-blue,
:root[data-theme="dark"] .rank-overview-card[class*="personality-"].aside-a1 {
  border-color: rgba(124, 181, 241, 0.46);
  background:
    linear-gradient(180deg, rgba(219, 235, 255, 0.12), transparent 42%),
    rgba(39, 67, 96, 0.96) !important;
}

:root[data-theme="dark"] .rank-overview-card[class*="personality-"].rank-green {
  border-color: rgba(121, 207, 143, 0.44);
  background:
    linear-gradient(180deg, rgba(221, 255, 229, 0.12), transparent 42%),
    rgba(39, 75, 51, 0.96) !important;
}

.rank-overview-card.bond-overview-card.bond-max {
  border-color: rgba(220, 38, 38, 0.26);
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.58), rgba(255, 255, 255, 0.76));
}

.rank-overview-card.bond-overview-card.bond-pink {
  border-color: rgba(236, 72, 153, 0.18);
  background: linear-gradient(135deg, rgba(255, 193, 215, 0.62), rgba(255, 255, 255, 0.76));
}

.rank-overview-card.bond-overview-card.bond-orange {
  border-color: rgba(234, 88, 12, 0.16);
  background: linear-gradient(135deg, rgba(253, 186, 116, 0.54), rgba(255, 255, 255, 0.76));
}

.rank-overview-card.bond-overview-card.bond-yellow {
  border-color: rgba(202, 138, 4, 0.16);
  background: linear-gradient(135deg, rgba(254, 240, 138, 0.52), rgba(255, 255, 255, 0.76));
}

.rank-overview-card.bond-overview-card.bond-none {
  border-color: rgba(44, 88, 59, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

:root[data-theme="dark"] .rank-overview-card.bond-overview-card.bond-max {
  border-color: rgba(248, 113, 113, 0.44);
  background:
    linear-gradient(180deg, rgba(255, 226, 226, 0.12), transparent 42%),
    rgba(93, 42, 43, 0.96) !important;
}

:root[data-theme="dark"] .rank-overview-card.bond-overview-card.bond-pink {
  border-color: rgba(244, 114, 182, 0.44);
  background:
    linear-gradient(180deg, rgba(255, 228, 239, 0.12), transparent 42%),
    rgba(83, 43, 65, 0.96) !important;
}

:root[data-theme="dark"] .rank-overview-card.bond-overview-card.bond-orange {
  border-color: rgba(251, 146, 60, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 237, 213, 0.12), transparent 42%),
    rgba(86, 55, 35, 0.96) !important;
}

:root[data-theme="dark"] .rank-overview-card.bond-overview-card.bond-yellow {
  border-color: rgba(250, 204, 21, 0.4);
  background:
    linear-gradient(180deg, rgba(254, 249, 195, 0.12), transparent 42%),
    rgba(76, 65, 34, 0.96) !important;
}

:root[data-theme="dark"] .rank-overview-card.bond-overview-card.bond-none {
  border-color: rgba(177, 190, 210, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%),
    rgba(44, 55, 70, 0.96) !important;
}

:root[data-theme="dark"] .aside-overview-card .rank-overview-icon {
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .aside-overview-card.aside-off .rank-overview-icon {
  opacity: 0.56;
  filter: grayscale(1) brightness(0.9);
}

:root[data-theme="dark"] .aside-overview-card:not(.aside-off) .rank-overview-icon {
  opacity: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22));
}

:root[data-theme="dark"] .apostle-picker-sort,
:root[data-theme="dark"] .apostle-filter-details,
:root[data-theme="dark"] .formation-picker-sort,
:root[data-theme="dark"] .formation-filter-details,
:root[data-theme="dark"] .card-manager-controls,
:root[data-theme="dark"] .board-global-toolbar,
:root[data-theme="dark"] .board-global-filter-details,
:root[data-theme="dark"] .research-controls,
:root[data-theme="dark"] .research-overview-details,
:root[data-theme="dark"] .equipment-head-controls {
  color: rgba(232, 240, 236, 0.9) !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .apostle-filter-details summary,
:root[data-theme="dark"] .formation-filter-details summary,
:root[data-theme="dark"] .board-global-filter-details summary,
:root[data-theme="dark"] .research-overview-details summary {
  color: rgba(248, 250, 252, 0.95) !important;
  background: transparent !important;
}

.board-global-toolbar .board-global-mode {
  display: none;
}

:root[data-theme="dark"] .apostle-picker-sort span,
:root[data-theme="dark"] .formation-picker-sort span,
:root[data-theme="dark"] .board-global-search span,
:root[data-theme="dark"] .card-manager-search span,
:root[data-theme="dark"] .card-manager-select span,
:root[data-theme="dark"] .card-manager-owned-filter,
:root[data-theme="dark"] .research-controls label,
:root[data-theme="dark"] .equipment-head-controls label {
  color: rgba(213, 226, 218, 0.84) !important;
}

:root[data-theme="dark"] .apostle-picker-sort select,
:root[data-theme="dark"] .formation-picker-sort select,
:root[data-theme="dark"] .board-global-search input,
:root[data-theme="dark"] .board-global-sort select,
:root[data-theme="dark"] .card-manager-search input,
:root[data-theme="dark"] .card-manager-select select,
:root[data-theme="dark"] .research-controls select,
:root[data-theme="dark"] .equipment-head-controls select {
  color-scheme: dark !important;
  color: rgba(248, 250, 252, 0.96) !important;
  border-color: rgba(148, 177, 160, 0.28) !important;
  background: rgba(9, 18, 16, 0.62) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22) !important;
}

:root[data-theme="dark"] .apostle-picker-sort select option,
:root[data-theme="dark"] .formation-picker-sort select option,
:root[data-theme="dark"] .board-global-sort select option,
:root[data-theme="dark"] .card-manager-select select option,
:root[data-theme="dark"] .research-controls select option,
:root[data-theme="dark"] .equipment-head-controls select option {
  color: rgba(248, 250, 252, 0.96) !important;
  background: #14211d !important;
}

:root[data-theme="dark"] .apostle-picker-filters,
:root[data-theme="dark"] .board-global-filters {
  color: rgba(232, 240, 236, 0.9) !important;
}

:root[data-theme="dark"] .apostle-picker-filters button,
:root[data-theme="dark"] .board-global-filters button,
:root[data-theme="dark"] .board-global-actions button {
  color: rgba(238, 247, 242, 0.94) !important;
  border-color: rgba(148, 177, 160, 0.25) !important;
  background: rgba(25, 42, 37, 0.86) !important;
}

:root[data-theme="dark"] .apostle-picker-filters button:hover:not(:disabled),
:root[data-theme="dark"] .board-global-filters button:hover:not(:disabled),
:root[data-theme="dark"] .board-global-actions button:hover:not(:disabled),
:root[data-theme="dark"] .apostle-picker-filters button.is-active,
:root[data-theme="dark"] .board-global-filters button.is-active,
:root[data-theme="dark"] .apostle-picker-filters button[aria-pressed="true"],
:root[data-theme="dark"] .board-global-filters button[aria-pressed="true"] {
  color: #ffffff !important;
  border-color: rgba(134, 239, 172, 0.52) !important;
  background: rgba(38, 105, 67, 0.9) !important;
}

:root[data-theme="dark"] .board-global-filters button[data-board-global-filter-group="layers"][data-board-global-filter-value="1"] {
  color: #d9f99d !important;
  border-color: rgba(132, 204, 22, 0.44) !important;
  background: rgba(54, 83, 20, 0.82) !important;
}

:root[data-theme="dark"] .board-global-filters button[data-board-global-filter-group="layers"][data-board-global-filter-value="2"] {
  color: #bfdbfe !important;
  border-color: rgba(96, 165, 250, 0.46) !important;
  background: rgba(30, 58, 138, 0.74) !important;
}

:root[data-theme="dark"] .board-global-filters button[data-board-global-filter-group="layers"][data-board-global-filter-value="3"] {
  color: #f0abfc !important;
  border-color: rgba(217, 70, 239, 0.46) !important;
  background: rgba(112, 26, 117, 0.72) !important;
}

:root[data-theme="dark"] .board-global-filters button[data-board-global-filter-group="layers"].is-active,
:root[data-theme="dark"] .board-global-filters button[data-board-global-filter-group="layers"][aria-pressed="true"] {
  color: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .board-global-filters button[data-board-global-filter-group="layers"][data-board-global-filter-value="1"].is-active,
:root[data-theme="dark"] .board-global-filters button[data-board-global-filter-group="layers"][data-board-global-filter-value="1"][aria-pressed="true"] {
  border-color: rgba(190, 242, 100, 0.68) !important;
  background: linear-gradient(180deg, rgba(101, 163, 13, 0.96), rgba(63, 98, 18, 0.94)) !important;
}

:root[data-theme="dark"] .board-global-filters button[data-board-global-filter-group="layers"][data-board-global-filter-value="2"].is-active,
:root[data-theme="dark"] .board-global-filters button[data-board-global-filter-group="layers"][data-board-global-filter-value="2"][aria-pressed="true"] {
  border-color: rgba(147, 197, 253, 0.7) !important;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.94), rgba(30, 64, 175, 0.92)) !important;
}

:root[data-theme="dark"] .board-global-filters button[data-board-global-filter-group="layers"][data-board-global-filter-value="3"].is-active,
:root[data-theme="dark"] .board-global-filters button[data-board-global-filter-group="layers"][data-board-global-filter-value="3"][aria-pressed="true"] {
  border-color: rgba(240, 171, 252, 0.7) !important;
  background: linear-gradient(180deg, rgba(192, 38, 211, 0.92), rgba(126, 34, 206, 0.92)) !important;
}

:root[data-theme="dark"] .dashboard-persistent-profile {
  border-color: var(--line) !important;
  background: var(--dashboard-dark-panel) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22) !important;
}

:root[data-theme="dark"] .portrait-frame.dashboard-portrait {
  border: 1px solid color-mix(in srgb, var(--profile-personality-color) 52%, rgba(255, 255, 255, 0.16));
  background:
    radial-gradient(circle at 50% 42%,
      color-mix(in srgb, var(--profile-personality-color) 34%, rgba(255, 255, 255, 0.1)),
      color-mix(in srgb, var(--profile-personality-color) 16%, rgba(20, 32, 31, 0.84)) 66%,
      rgba(11, 18, 17, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 8px 18px rgba(0, 0, 0, 0.26);
}

:root[data-theme="dark"] .dashboard-portrait > #apostle-image {
  background: transparent !important;
}

:root[data-theme="dark"] .equipment-orbit {
  background: transparent;
}

:root[data-theme="dark"] .equipment-center-apostle {
  color: rgba(238, 247, 242, 0.95);
}

:root[data-theme="dark"] .equipment-center-portrait {
  border-color: color-mix(in srgb, var(--profile-personality-color) 52%, rgba(255, 255, 255, 0.16));
  background: color-mix(in srgb, var(--profile-personality-color) 22%, rgba(10, 16, 15, 0.92));
  box-shadow:
    0 0 0 3px rgba(22, 35, 31, 0.9),
    0 10px 24px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .equipment-center-portrait img {
  background: transparent !important;
}

:root[data-theme="dark"] .equipment-center-apostle > span {
  color: rgba(197, 215, 205, 0.72);
}

:root[data-theme="dark"] .dashboard-page .equipment-orbit-slot {
  color: rgba(238, 247, 242, 0.94);
  border-color: color-mix(in srgb, var(--equipment-rank-color) 42%, rgba(255, 255, 255, 0.16));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 46%),
    color-mix(in srgb, var(--equipment-rank-color) 12%, rgba(22, 34, 32, 0.9));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .dashboard-page .equipment-orbit-slot .kind {
  color: rgba(238, 247, 242, 0.94);
}

:root[data-theme="dark"] .dashboard-page .equipment-orbit-slot .tier {
  color: rgba(197, 215, 205, 0.72);
}

:root[data-theme="dark"] .dashboard-page .equipment-orbit-slot .equip-toggle {
  color: rgba(238, 247, 242, 0.94);
  background: color-mix(in srgb, var(--equipment-rank-color) 22%, rgba(15, 23, 42, 0.32));
}

:root[data-theme="dark"] .dashboard-page .equipment-orbit-slot .equip-toggle:has(input:not(:checked)) {
  color: rgba(197, 215, 205, 0.66);
  background: rgba(15, 23, 42, 0.34);
}

:root[data-theme="dark"] .setting-field-grid,
:root[data-theme="dark"] .setting-field-grid.compact,
:root[data-theme="dark"] .growth-settings .setting-field-grid,
:root[data-theme="dark"] .board-actions,
:root[data-theme="dark"] .board-draft-actions,
:root[data-theme="dark"] .card-manager-tools,
:root[data-theme="dark"] .rank-overview-tools {
  color: rgba(232, 240, 236, 0.9) !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .control-field,
:root[data-theme="dark"] .refined-follow-toggle {
  color: rgba(213, 226, 218, 0.84) !important;
}

:root[data-theme="dark"] .control-field select,
:root[data-theme="dark"] .refined-follow-toggle,
:root[data-theme="dark"] .board-actions button,
:root[data-theme="dark"] .board-mode-switch button,
:root[data-theme="dark"] .board-draft-actions button,
:root[data-theme="dark"] .board-open-global,
:root[data-theme="dark"] .card-manager-tabs button {
  color: rgba(248, 250, 252, 0.94) !important;
  border-color: rgba(148, 177, 160, 0.24) !important;
  background: rgba(18, 31, 48, 0.82) !important;
}

:root[data-theme="dark"] .control-field select option {
  color: rgba(248, 250, 252, 0.96) !important;
  background: #14211d !important;
}

/* 使徒設定一覧 */
.apostle-bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.apostle-bulk-search {
  flex: 1 1 260px;
  width: min(420px, 100%);
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.apostle-bulk-search input,
.apostle-bulk-sort select {
  min-height: 40px;
  border: 1px solid rgba(36, 83, 59, 0.2);
  border-radius: 11px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.92);
  font: inherit;
  font-size: 0.84rem;
}

.apostle-bulk-sort {
  flex: 0 0 164px;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.apostle-bulk-sort select {
  width: 100%;
  font-size: 0.78rem;
  font-weight: 800;
}

.apostle-bulk-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.apostle-bulk-list {
  display: grid;
  gap: 5px;
}

.apostle-bulk-row {
  --apostle-bulk-personality-color: #4b8a68;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 58px 64px minmax(180px, 0.8fr) minmax(345px, 1.7fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(36, 83, 59, 0.15);
  border-left: 4px solid color-mix(in srgb, var(--apostle-bulk-personality-color) 72%, #ffffff);
  border-radius: 11px;
  padding: 5px 7px;
  background: rgba(255, 253, 247, 0.72);
}

.apostle-bulk-row.personality-純粋 { --apostle-bulk-personality-color: var(--personality-pure); }
.apostle-bulk-row.personality-冷静 { --apostle-bulk-personality-color: var(--personality-calm); }
.apostle-bulk-row.personality-狂気 { --apostle-bulk-personality-color: var(--personality-madness); }
.apostle-bulk-row.personality-活発 { --apostle-bulk-personality-color: var(--personality-active); }
.apostle-bulk-row.personality-憂鬱 { --apostle-bulk-personality-color: var(--personality-gloomy); }

.apostle-bulk-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 9px;
  padding: 4px 6px 4px 4px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--apostle-bulk-personality-color) 17%, transparent),
    color-mix(in srgb, var(--apostle-bulk-personality-color) 5%, transparent));
  box-shadow: inset 2px 0 color-mix(in srgb, var(--apostle-bulk-personality-color) 58%, transparent);
}

.apostle-bulk-identity img {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--apostle-bulk-personality-color) 46%, rgba(36, 83, 59, 0.18));
  border-radius: 9px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.65);
}

.apostle-bulk-identity > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.apostle-bulk-identity strong,
.apostle-bulk-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apostle-bulk-identity strong {
  font-size: 0.78rem;
}

.apostle-bulk-identity small,
.apostle-bulk-group-title small {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 800;
}

.apostle-bulk-identity .apostle-bulk-combat-power {
  color: color-mix(in srgb, var(--apostle-bulk-personality-color) 72%, var(--ink));
  font-weight: 950;
  font-variant-numeric: tabular-nums lining-nums;
}

.apostle-bulk-field,
.apostle-bulk-group label {
  min-width: 0;
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
}

.apostle-bulk-field,
.apostle-bulk-group {
  height: 54px;
  box-sizing: border-box;
  border: 1px solid rgba(36, 83, 59, 0.13);
  border-radius: 9px;
  padding: 4px;
}

.apostle-bulk-field.is-star {
  border-color: rgba(190, 135, 26, 0.24);
  background: rgba(255, 205, 92, 0.1);
}

.apostle-bulk-field.is-level {
  border-color: rgba(54, 126, 181, 0.22);
  background: rgba(84, 165, 224, 0.09);
}

.apostle-bulk-skills {
  border-color: rgba(121, 84, 181, 0.22);
  background: rgba(143, 107, 204, 0.09);
}

.apostle-bulk-equipments {
  border-color: rgba(45, 137, 124, 0.22);
  background: rgba(69, 164, 150, 0.09);
}

.apostle-bulk-field :is(select, input),
.apostle-bulk-group select {
  width: 100%;
  min-width: 0;
  height: 30px;
  box-sizing: border-box;
  border: 1px solid rgba(36, 83, 59, 0.2);
  border-radius: 8px;
  padding: 0 5px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.7rem;
  font-weight: 800;
}

.apostle-bulk-field input {
  appearance: textfield;
}

.apostle-bulk-group {
  min-width: 0;
  margin: 0;
  align-items: center;
}

.apostle-bulk-group-title {
  display: grid;
  align-content: center;
  justify-items: center;
  align-self: stretch;
  min-width: 27px;
  padding: 0 3px 0 1px;
  border-right: 1px solid rgba(36, 83, 59, 0.13);
  color: var(--ink);
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1.05;
  white-space: nowrap;
}

.apostle-bulk-group-title small {
  margin-top: 2px;
  text-align: center;
}

.apostle-bulk-skills,
.apostle-bulk-equipments {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  gap: 3px;
}

.apostle-bulk-equipments {
  grid-template-columns: auto repeat(6, minmax(0, 1fr));
}

.apostle-bulk-equipment.is-off select {
  color: color-mix(in srgb, var(--muted) 82%, transparent);
  background: rgba(234, 238, 232, 0.66);
}

.apostle-bulk-group select:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

:root[data-theme="dark"] .apostle-bulk-row {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(14, 24, 38, 0.68);
}

:root[data-theme="dark"] .apostle-bulk-identity {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--apostle-bulk-personality-color) 20%, rgba(14, 24, 38, 0.45)),
    color-mix(in srgb, var(--apostle-bulk-personality-color) 7%, transparent));
  box-shadow: inset 2px 0 color-mix(in srgb, var(--apostle-bulk-personality-color) 68%, transparent);
}

:root[data-theme="dark"] .apostle-bulk-search input,
:root[data-theme="dark"] .apostle-bulk-sort select,
:root[data-theme="dark"] .apostle-bulk-field :is(select, input),
:root[data-theme="dark"] .apostle-bulk-group select {
  color: rgba(248, 250, 252, 0.95);
  border-color: rgba(148, 177, 160, 0.24);
  background: rgba(18, 31, 48, 0.9);
}

:root[data-theme="dark"] .apostle-bulk-group {
  border-color: rgba(148, 163, 184, 0.17);
}

:root[data-theme="dark"] .apostle-bulk-field.is-star {
  border-color: rgba(247, 196, 91, 0.26);
  background: rgba(190, 135, 26, 0.12);
}

:root[data-theme="dark"] .apostle-bulk-field.is-level {
  border-color: rgba(105, 181, 235, 0.24);
  background: rgba(54, 126, 181, 0.12);
}

:root[data-theme="dark"] .apostle-bulk-skills {
  border-color: rgba(178, 139, 235, 0.24);
  background: rgba(121, 84, 181, 0.12);
}

:root[data-theme="dark"] .apostle-bulk-equipments {
  border-color: rgba(101, 201, 185, 0.24);
  background: rgba(45, 137, 124, 0.12);
}

:root[data-theme="dark"] .apostle-bulk-group-title {
  border-right-color: rgba(148, 163, 184, 0.17);
}

:root[data-theme="dark"] .apostle-bulk-equipment.is-off select {
  color: rgba(190, 202, 215, 0.65);
  background: rgba(15, 23, 42, 0.72);
}

:root[data-theme="dark"] .apostle-bulk-search input::placeholder {
  color: rgba(190, 202, 215, 0.58);
}

@media (max-width: 850px) {
  .apostle-bulk-row {
    grid-template-columns: minmax(140px, 1fr) 58px 64px minmax(180px, 1fr);
  }

  .apostle-bulk-equipments {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .apostle-bulk-row {
    grid-template-columns: minmax(120px, 1fr) 54px 60px minmax(155px, 1fr);
  }

  .apostle-bulk-identity {
    align-self: center;
  }

  .apostle-bulk-equipments {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .apostle-bulk-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
  }

  .apostle-bulk-search {
    grid-column: 1 / -1;
  }

  .apostle-bulk-sort {
    width: min(164px, 100%);
  }

  .apostle-bulk-count {
    align-self: flex-end;
  }

  .apostle-bulk-row {
    grid-template-columns: minmax(0, 1fr) 56px 62px;
    gap: 5px;
    padding: 5px;
  }

  .apostle-bulk-identity img {
    width: 34px;
    height: 34px;
  }

  .apostle-bulk-skills,
  .apostle-bulk-equipments {
    grid-column: 1 / -1;
  }

  .apostle-bulk-equipments {
    grid-template-columns: auto repeat(6, minmax(0, 1fr));
  }
}

.board-progress-open {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(57, 104, 74, 0.28);
  border-radius: 12px;
  padding: 6px 11px;
  color: var(--green-dark);
  background: linear-gradient(135deg, rgba(236, 249, 240, 0.96), rgba(224, 240, 255, 0.9));
  font-size: 0.74rem;
  font-weight: 900;
  cursor: pointer;
}

.board-progress-open strong {
  border-radius: 999px;
  padding: 3px 7px;
  color: #fff;
  background: #347758;
  font-size: 0.68rem;
}

.board-progress-overview {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 38px minmax(100px, 1fr) auto auto auto;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(57, 104, 74, 0.26);
  border-radius: 14px;
  padding: 7px 10px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(233, 248, 238, 0.96), rgba(232, 243, 255, 0.94));
  text-align: left;
  cursor: pointer;
}

.board-progress-overview:hover,
.board-progress-overview:focus-visible {
  border-color: rgba(49, 127, 83, 0.52);
  background: linear-gradient(135deg, rgba(222, 245, 229, 0.98), rgba(221, 238, 255, 0.98));
}

.board-progress-target-icons {
  position: relative;
  display: block;
}

.board-progress-target-icons img {
  display: block;
  object-fit: contain;
}

.board-progress-overview-icons {
  width: 36px;
  height: 36px;
}

.board-progress-overview-icons img {
  width: 36px;
  height: 36px;
}

.board-progress-overview-icons.is-multiple img {
  position: absolute;
  width: 27px;
  height: 27px;
}

.board-progress-overview-icons.is-multiple img:first-child {
  top: 0;
  left: 0;
}

.board-progress-overview-icons.is-multiple img:last-child {
  right: 0;
  bottom: 0;
}

.board-progress-overview-label {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.board-progress-overview-label small {
  color: rgba(47, 72, 55, 0.66);
  font-size: 0.63rem;
  font-weight: 900;
}

.board-progress-overview-label strong {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-progress-overview-count {
  color: rgba(47, 72, 55, 0.72);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.board-progress-overview-count strong,
.board-progress-overview-rate {
  color: #28754e;
  font-weight: 950;
}

.board-progress-overview-rate {
  font-size: 0.86rem;
  white-space: nowrap;
}

.board-progress-overview-detail {
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  background: #347758;
  font-size: 0.64rem;
  font-weight: 950;
}

.board-global-effect-summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 2px 4px;
  color: rgba(47, 72, 55, 0.74);
  font-size: 0.68rem;
}

.board-global-effect-summary-heading span {
  font-size: 0.62rem;
  font-weight: 800;
}

.board-progress-dialog {
  width: min(760px, calc(100vw - 28px));
  max-width: none;
  max-height: min(86dvh, 820px);
  box-sizing: border-box;
  border: 1px solid rgba(45, 91, 62, 0.28);
  border-radius: 20px;
  padding: 0;
  color: var(--ink);
  background: var(--paper-strong);
  box-shadow: 0 24px 64px rgba(17, 45, 27, 0.28);
  overflow: hidden;
}

.board-progress-dialog::backdrop {
  background: rgba(9, 22, 15, 0.56);
  backdrop-filter: blur(2px);
}

.board-progress-dialog-head {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(57, 104, 74, 0.16);
  padding: 10px 14px 10px 18px;
  background: linear-gradient(135deg, rgba(231, 247, 236, 0.96), rgba(237, 245, 255, 0.96));
}

.board-progress-dialog-head h2 {
  margin: 2px 0 0;
  font-size: 1.02rem;
  line-height: 1.25;
}

.board-progress-dialog-kicker {
  color: rgba(48, 83, 58, 0.72);
  font-size: 0.68rem;
  font-weight: 900;
}

.board-progress-dialog-body {
  max-height: calc(min(86dvh, 820px) - 68px);
  box-sizing: border-box;
  padding: 14px 18px 18px;
  overflow: auto;
}

.board-progress-loading {
  min-height: 210px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: rgba(47, 70, 54, 0.72);
  font-size: 0.78rem;
}

.board-progress-loading span {
  width: 30px;
  height: 30px;
  box-sizing: border-box;
  border: 3px solid rgba(57, 124, 89, 0.18);
  border-top-color: #397c59;
  border-radius: 50%;
  animation: board-progress-spin 0.8s linear infinite;
}

@keyframes board-progress-spin {
  to { transform: rotate(360deg); }
}

.board-progress-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  color: rgba(44, 70, 52, 0.72);
  font-size: 0.7rem;
  font-weight: 800;
}

.board-progress-mode,
.board-progress-editing {
  border-radius: 999px;
  padding: 3px 8px;
  color: #246244;
  background: rgba(68, 164, 103, 0.14);
}

.board-progress-mode.is-plan {
  color: #5a45a0;
  background: rgba(124, 105, 204, 0.14);
}

.board-progress-editing {
  color: #a45c15;
  background: rgba(245, 158, 11, 0.14);
}

.board-progress-layer-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 10px;
}

.board-progress-layer-tabs button {
  min-height: 34px;
  border: 1px solid rgba(76, 92, 81, 0.18);
  border-radius: 10px;
  color: rgba(42, 65, 49, 0.78);
  background: rgba(255, 255, 255, 0.62);
  font-weight: 900;
  cursor: pointer;
}

.board-progress-layer-tabs button.is-active {
  color: #fff;
  border-color: #586873;
  background: #586873;
}

.board-progress-layer-tabs button[data-board-progress-layer="1"] {
  color: #27653d;
  border-color: rgba(53, 139, 76, 0.3);
  background: rgba(217, 244, 221, 0.66);
}

.board-progress-layer-tabs button[data-board-progress-layer="2"] {
  color: #285f9b;
  border-color: rgba(49, 111, 180, 0.3);
  background: rgba(216, 235, 255, 0.7);
}

.board-progress-layer-tabs button[data-board-progress-layer="3"] {
  color: #6b4587;
  border-color: rgba(116, 85, 141, 0.32);
  background: rgba(237, 222, 250, 0.72);
}

.board-progress-layer-tabs button[data-board-progress-layer="1"].is-active {
  color: #fff;
  border-color: #3f8752;
  background: #3f8752;
}

.board-progress-layer-tabs button[data-board-progress-layer="2"].is-active {
  color: #fff;
  border-color: #316fb4;
  background: #316fb4;
}

.board-progress-layer-tabs button[data-board-progress-layer="3"].is-active {
  color: #fff;
  border-color: #74558d;
  background: #74558d;
}

.board-progress-tile-filter {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: -2px 0 9px;
}

.board-progress-tile-filter > span {
  margin-right: 2px;
  color: rgba(47, 72, 55, 0.68);
  font-size: 0.68rem;
  font-weight: 900;
}

.board-progress-tile-filter button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(57, 95, 69, 0.2);
  border-radius: 999px;
  padding: 3px 9px 3px 6px;
  color: rgba(42, 65, 49, 0.72);
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.68rem;
  font-weight: 900;
  cursor: pointer;
}

.board-progress-tile-filter button img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: grayscale(0.65);
  opacity: 0.64;
}

.board-progress-tile-filter button.is-active {
  color: #236343;
  border-color: rgba(49, 127, 83, 0.52);
  background: rgba(222, 245, 229, 0.92);
}

.board-progress-tile-filter button.is-active img {
  filter: none;
  opacity: 1;
}

.board-progress-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.board-progress-category {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 1px 6px;
  border: 1px solid rgba(57, 95, 69, 0.18);
  border-radius: 12px;
  padding: 7px 8px;
  color: var(--ink);
  background: rgba(248, 252, 249, 0.88);
  text-align: left;
  cursor: pointer;
}

.board-progress-category img {
  width: 28px;
  height: 28px;
  grid-row: 1 / 3;
  object-fit: contain;
}

.board-progress-category-target-icons {
  width: 28px;
  height: 28px;
  grid-row: 1 / 3;
  overflow: visible !important;
}

.board-progress-category-target-icons img {
  width: 28px;
  height: 28px;
}

.board-progress-category-target-icons.is-multiple img {
  position: absolute;
  width: 21px;
  height: 21px;
}

.board-progress-category-target-icons.is-multiple img:first-child {
  top: 0;
  left: 0;
}

.board-progress-category-target-icons.is-multiple img:last-child {
  right: 0;
  bottom: 0;
}

.board-progress-category span,
.board-progress-category strong,
.board-progress-category small {
  min-width: 0;
}

.board-progress-category span {
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-progress-category strong {
  grid-column: 3;
  grid-row: 1 / 3;
  color: #2f7753;
  font-size: 0.82rem;
}

.board-progress-category small {
  color: rgba(47, 70, 54, 0.62);
  font-size: 0.64rem;
  font-weight: 800;
}

.board-progress-category.is-active {
  border-color: rgba(49, 127, 83, 0.64);
  background: rgba(222, 245, 229, 0.94);
  box-shadow: inset 0 0 0 1px rgba(49, 127, 83, 0.16);
}

.board-progress-resource-panel {
  margin-top: 12px;
  border: 1px solid rgba(83, 101, 113, 0.22);
  border-radius: 16px;
  padding: 12px;
  background: rgba(239, 243, 246, 0.72);
}

.board-progress-resource-panel.board-progress-resource-layer-1 {
  border-color: rgba(53, 139, 76, 0.3);
  background: rgba(226, 246, 230, 0.68);
}

.board-progress-resource-panel.board-progress-resource-layer-2 {
  border-color: rgba(49, 111, 180, 0.3);
  background: rgba(225, 239, 255, 0.7);
}

.board-progress-resource-panel.board-progress-resource-layer-3 {
  border-color: rgba(116, 85, 141, 0.32);
  background: rgba(241, 230, 250, 0.7);
}

.board-progress-resource-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.board-progress-resource-head div {
  display: grid;
  gap: 1px;
}

.board-progress-resource-head span {
  color: rgba(47, 72, 55, 0.68);
  font-size: 0.7rem;
  font-weight: 800;
}

.board-progress-resource-head strong {
  font-size: 0.94rem;
}

.board-progress-ring {
  --board-progress: 0;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#43a96f calc(var(--board-progress) * 1%), rgba(47, 82, 58, 0.13) 0);
  box-shadow: inset 0 0 0 1px rgba(47, 105, 67, 0.1);
}

.board-progress-resource-main {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.board-progress-resource-detail {
  min-width: 0;
}

.board-progress-ring::before {
  content: "";
  width: 56px;
  height: 56px;
  grid-area: 1 / 1;
  border-radius: 50%;
  background: var(--paper-strong);
  box-shadow: 0 0 0 1px rgba(47, 105, 67, 0.08);
}

.board-progress-ring > span {
  z-index: 1;
  grid-area: 1 / 1;
  display: grid;
  justify-items: center;
  line-height: 1;
}

.board-progress-ring strong {
  color: #28754e;
  font-size: 1rem;
}

.board-progress-ring small {
  margin-top: 3px;
  color: rgba(47, 72, 55, 0.62);
  font-size: 0.55rem;
  font-weight: 900;
}

.board-progress-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 7px;
}

.board-progress-counts span {
  border-radius: 9px;
  padding: 6px 8px;
  color: rgba(42, 66, 49, 0.72);
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.67rem;
  font-weight: 800;
  text-align: center;
}

.board-progress-counts strong {
  color: #244f37;
  font-size: 0.82rem;
}

.board-progress-resource-list .board-global-cost-summary {
  margin: 0;
}

.board-progress-note,
.board-progress-warning {
  margin: 8px 2px 0;
  color: rgba(47, 70, 54, 0.66);
  font-size: 0.67rem;
  font-weight: 700;
}

.board-progress-warning {
  color: #a74335;
}

:root[data-theme="dark"] .board-progress-open {
  color: #dcfce7;
  border-color: rgba(134, 239, 172, 0.28);
  background: linear-gradient(135deg, rgba(28, 72, 48, 0.86), rgba(30, 58, 90, 0.86));
}

:root[data-theme="dark"] .board-progress-overview {
  color: #edf7f0;
  border-color: rgba(134, 239, 172, 0.26);
  background: linear-gradient(135deg, rgba(25, 71, 47, 0.88), rgba(25, 51, 80, 0.88));
}

:root[data-theme="dark"] .board-progress-overview:hover,
:root[data-theme="dark"] .board-progress-overview:focus-visible {
  border-color: rgba(134, 239, 172, 0.48);
  background: linear-gradient(135deg, rgba(30, 87, 56, 0.94), rgba(30, 62, 96, 0.94));
}

:root[data-theme="dark"] .board-progress-overview-label small,
:root[data-theme="dark"] .board-progress-overview-count,
:root[data-theme="dark"] .board-global-effect-summary-heading {
  color: rgba(226, 232, 240, 0.72);
}

:root[data-theme="dark"] .board-progress-overview-count strong,
:root[data-theme="dark"] .board-progress-overview-rate {
  color: #86efac;
}

:root[data-theme="dark"] .board-progress-dialog {
  color: #edf7f0;
  border-color: rgba(148, 163, 184, 0.24);
  background: #111c20;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.62);
}

:root[data-theme="dark"] .board-progress-dialog-head {
  border-color: rgba(148, 163, 184, 0.16);
  background: linear-gradient(135deg, rgba(25, 66, 44, 0.98), rgba(23, 45, 72, 0.98));
}

:root[data-theme="dark"] .board-progress-dialog-kicker,
:root[data-theme="dark"] .board-progress-context,
:root[data-theme="dark"] .board-progress-resource-head span,
:root[data-theme="dark"] .board-progress-note,
:root[data-theme="dark"] .board-progress-loading {
  color: rgba(226, 232, 240, 0.7);
}

:root[data-theme="dark"] .board-progress-mode {
  color: #dcfce7;
  border: 1px solid rgba(74, 222, 128, 0.34);
  background: rgba(22, 163, 74, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .board-progress-mode.is-plan {
  color: #ede9fe;
  border-color: rgba(196, 181, 253, 0.38);
  background: rgba(124, 58, 237, 0.3);
}

:root[data-theme="dark"] .board-progress-editing {
  color: #fef3c7;
  border: 1px solid rgba(251, 191, 36, 0.34);
  background: rgba(180, 83, 9, 0.3);
}

:root[data-theme="dark"] .board-progress-layer-tabs button,
:root[data-theme="dark"] .board-progress-category,
:root[data-theme="dark"] .board-progress-counts span {
  color: rgba(241, 245, 249, 0.94);
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(30, 41, 59, 0.72);
}

:root[data-theme="dark"] .board-progress-layer-tabs button.is-active {
  border-color: rgba(148, 163, 184, 0.62);
  background: rgba(71, 85, 105, 0.96);
}

:root[data-theme="dark"] .board-progress-layer-tabs button[data-board-progress-layer="1"] {
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(34, 197, 94, 0.14);
}

:root[data-theme="dark"] .board-progress-layer-tabs button[data-board-progress-layer="2"] {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(59, 130, 246, 0.16);
}

:root[data-theme="dark"] .board-progress-layer-tabs button[data-board-progress-layer="3"] {
  color: #e9d5ff;
  border-color: rgba(196, 181, 253, 0.3);
  background: rgba(168, 85, 247, 0.16);
}

:root[data-theme="dark"] .board-progress-layer-tabs button[data-board-progress-layer="1"].is-active {
  color: #fff;
  border-color: rgba(74, 222, 128, 0.58);
  background: rgba(29, 116, 71, 0.96);
}

:root[data-theme="dark"] .board-progress-layer-tabs button[data-board-progress-layer="2"].is-active {
  color: #fff;
  border-color: rgba(96, 165, 250, 0.62);
  background: rgba(37, 99, 235, 0.92);
}

:root[data-theme="dark"] .board-progress-layer-tabs button[data-board-progress-layer="3"].is-active {
  color: #fff;
  border-color: rgba(196, 181, 253, 0.58);
  background: rgba(126, 34, 206, 0.9);
}

:root[data-theme="dark"] .board-progress-tile-filter > span {
  color: rgba(226, 232, 240, 0.68);
}

:root[data-theme="dark"] .board-progress-tile-filter button {
  color: rgba(226, 232, 240, 0.72);
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(30, 41, 59, 0.72);
}

:root[data-theme="dark"] .board-progress-tile-filter button.is-active {
  color: #dcfce7;
  border-color: rgba(74, 222, 128, 0.48);
  background: rgba(27, 85, 54, 0.78);
}

:root[data-theme="dark"] .board-progress-category.is-active {
  border-color: rgba(74, 222, 128, 0.48);
  background: rgba(27, 85, 54, 0.78);
}

:root[data-theme="dark"] .board-progress-category strong,
:root[data-theme="dark"] .board-progress-ring strong,
:root[data-theme="dark"] .board-progress-counts strong {
  color: #86efac;
}

:root[data-theme="dark"] .board-progress-ring {
  background: conic-gradient(#4ade80 calc(var(--board-progress) * 1%), rgba(148, 163, 184, 0.18) 0);
  box-shadow: inset 0 0 0 1px rgba(134, 239, 172, 0.12);
}

:root[data-theme="dark"] .board-progress-ring::before {
  background: #111c20;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.12);
}

:root[data-theme="dark"] .board-progress-ring small {
  color: rgba(226, 232, 240, 0.64);
}

:root[data-theme="dark"] .board-progress-category small {
  color: rgba(226, 232, 240, 0.62);
}

:root[data-theme="dark"] .board-progress-resource-panel {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(8, 18, 24, 0.58);
}

:root[data-theme="dark"] .board-progress-resource-panel.board-progress-resource-layer-1 {
  border-color: rgba(74, 222, 128, 0.24);
  background: rgba(15, 48, 31, 0.58);
}

:root[data-theme="dark"] .board-progress-resource-panel.board-progress-resource-layer-2 {
  border-color: rgba(96, 165, 250, 0.26);
  background: rgba(16, 37, 69, 0.62);
}

:root[data-theme="dark"] .board-progress-resource-panel.board-progress-resource-layer-3 {
  border-color: rgba(196, 181, 253, 0.26);
  background: rgba(48, 27, 73, 0.62);
}

@media (max-width: 620px) {
  .board-progress-overview {
    grid-template-columns: 34px minmax(80px, 1fr) auto auto auto;
    gap: 5px;
    padding-inline: 7px;
  }

  .board-progress-overview-icons {
    width: 32px;
    height: 32px;
  }

  .board-progress-overview-icons img {
    width: 32px;
    height: 32px;
  }

  .board-progress-overview-icons.is-multiple img {
    width: 24px;
    height: 24px;
  }

  .board-progress-overview-label strong {
    font-size: 0.74rem;
  }

  .board-progress-overview-detail {
    padding-inline: 6px;
  }

  .board-progress-dialog {
    width: 100%;
    max-height: min(88dvh, 760px);
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: 18px 18px 0 0;
  }

  .board-progress-dialog-body {
    max-height: calc(min(88dvh, 760px) - 64px);
    padding: 10px 10px max(14px, env(safe-area-inset-bottom));
  }

  .board-progress-dialog-head {
    min-height: 64px;
    padding: 8px 10px 8px 14px;
  }

  .board-progress-dialog-head h2 {
    font-size: 0.9rem;
  }

  .board-progress-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .board-progress-tile-filter {
    margin-bottom: 7px;
  }

  .board-progress-category {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    padding: 6px;
  }

  .board-progress-category img {
    width: 24px;
    height: 24px;
  }

  .board-progress-counts {
    gap: 3px;
  }

  .board-progress-counts span {
    padding: 5px 2px;
    font-size: 0.61rem;
    white-space: nowrap;
  }

  .board-progress-counts strong {
    display: block;
  }

  .board-progress-ring {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
  }

  .board-progress-ring::before {
    width: 46px;
    height: 46px;
  }

  .board-progress-resource-main {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 7px;
  }

  .board-progress-ring strong {
    font-size: 0.84rem;
  }

  .board-progress-ring small {
    font-size: 0.49rem;
  }
}


:root[data-theme="dark"] .refined-follow-toggle:has(input:checked),
:root[data-theme="dark"] .board-mode-switch button.is-active,
:root[data-theme="dark"] .card-manager-tabs button.is-active {
  color: #ffffff !important;
  border-color: rgba(134, 239, 172, 0.46) !important;
  background: rgba(38, 105, 67, 0.88) !important;
}

:root[data-theme="dark"] .card-manager-tools,
:root[data-theme="dark"] .formation-save-panel,
:root[data-theme="dark"] .formation-save-editor,
:root[data-theme="dark"] .formation-save-list,
:root[data-theme="dark"] .formation-preset-details,
:root[data-theme="dark"] .formation-synergy-summary,
:root[data-theme="dark"] .formation-spell-list,
:root[data-theme="dark"] .formation-spell-catalog {
  color: rgba(238, 247, 242, 0.94) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  background: rgba(14, 22, 31, 0.72) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .card-manager-summary,
:root[data-theme="dark"] .card-manager-summary span {
  color: rgba(238, 247, 242, 0.94) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  background: rgba(14, 22, 31, 0.82) !important;
}

:root[data-theme="dark"] .card-manager-owned-filter,
:root[data-theme="dark"] .card-manager-select,
:root[data-theme="dark"] .card-manager-search,
:root[data-theme="dark"] .card-manager-bulk-tools > button,
:root[data-theme="dark"] .formation-save-actions button,
:root[data-theme="dark"] .formation-preset-shortcuts button,
:root[data-theme="dark"] .formation-preset-card,
:root[data-theme="dark"] .formation-preset-details summary,
:root[data-theme="dark"] .formation-preset-actions button,
:root[data-theme="dark"] .formation-preset-slot-picker button {
  color: rgba(248, 250, 252, 0.94) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  background: rgba(18, 31, 48, 0.82) !important;
}

:root[data-theme="dark"] .formation-preset-shortcuts button.is-selected,
:root[data-theme="dark"] .formation-preset-card.is-selected,
:root[data-theme="dark"] .formation-preset-slot-picker button.is-selected {
  border-color: rgba(134, 239, 172, 0.46) !important;
  background: rgba(38, 105, 67, 0.88) !important;
}

:root[data-theme="dark"] .formation-active-preset.is-dirty {
  color: #fed7aa !important;
  background: linear-gradient(135deg, rgba(154, 52, 18, 0.82), rgba(120, 53, 15, 0.74)) !important;
  box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.34);
}

:root[data-theme="dark"] .formation-active-preset.is-dirty strong {
  color: #fff7ed;
}

:root[data-theme="dark"] .formation-save-actions button.is-dirty {
  color: #fff7ed !important;
  border-color: rgba(251, 146, 60, 0.48) !important;
  background: linear-gradient(135deg, #c2410c, #b45309) !important;
  box-shadow: 0 5px 14px rgba(194, 65, 12, 0.28);
}

:root[data-theme="dark"] .formation-preset-details summary span,
:root[data-theme="dark"] .formation-preset-card span,
:root[data-theme="dark"] .formation-preset-card small,
:root[data-theme="dark"] .formation-save-empty,
:root[data-theme="dark"] .formation-spell-head small,
:root[data-theme="dark"] .formation-spell-empty {
  color: rgba(203, 213, 225, 0.76) !important;
}

.formation-active-preset span,
.formation-active-preset strong,
.formation-active-preset small,
.formation-active-preset b,
.formation-preset-shortcuts button strong,
.formation-preset-details summary,
.formation-preset-details summary span,
.formation-preset-card strong,
.formation-preset-card span,
.formation-preset-card small,
.formation-preset-card b {
  text-shadow: none;
}

.formation-active-preset span {
  color: #386043;
}

.formation-preset-shortcuts button strong,
.formation-preset-card strong {
  color: #24442e;
}

.formation-preset-card span,
.formation-preset-card small,
.formation-preset-details summary span {
  color: rgba(42, 74, 50, 0.74);
}

.formation-preset-card b,
.formation-active-preset b {
  color: #2f6f4c;
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="dark"] .formation-active-preset {
  color: #d9f5e3 !important;
  background: rgba(18, 31, 48, 0.78) !important;
}

:root[data-theme="dark"] .formation-active-preset.is-active {
  color: #ecfdf5 !important;
  border-color: rgba(134, 239, 172, 0.24) !important;
  background: linear-gradient(135deg, rgba(25, 67, 50, 0.82), rgba(18, 31, 48, 0.82)) !important;
}

:root[data-theme="dark"] .formation-active-preset span {
  color: #bbf7d0 !important;
}

:root[data-theme="dark"] .formation-active-preset strong,
:root[data-theme="dark"] .formation-preset-shortcuts button strong,
:root[data-theme="dark"] .formation-preset-card strong,
:root[data-theme="dark"] .formation-preset-details summary {
  color: #f8fafc !important;
}

:root[data-theme="dark"] .formation-active-preset small,
:root[data-theme="dark"] .formation-preset-card span,
:root[data-theme="dark"] .formation-preset-card small,
:root[data-theme="dark"] .formation-preset-details summary span {
  color: #cbd5e1 !important;
}

:root[data-theme="dark"] .formation-active-preset b,
:root[data-theme="dark"] .formation-preset-card b {
  color: #dcfce7 !important;
  background: rgba(34, 197, 94, 0.18) !important;
}

:root[data-theme="dark"] .formation-preset-shortcuts button span {
  color: #ffffff !important;
  background: linear-gradient(135deg, #4ade80, #15803d) !important;
}

:root[data-theme="dark"] .formation-active-preset em {
  color: #fff7ed !important;
  background: rgba(249, 115, 22, 0.92) !important;
}

:root[data-theme="dark"] .formation-synergy-personality {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .formation-synergy-race {
  border-color: transparent !important;
  background: transparent !important;
}

:root[data-theme="dark"] .formation-synergy-summary {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .formation-member-summary {
  color: rgba(203, 213, 225, 0.82) !important;
}

:root[data-theme="dark"] .formation-member-count {
  color: rgba(226, 232, 240, 0.9) !important;
  border-color: rgba(134, 239, 172, 0.22) !important;
  background: rgba(22, 101, 52, 0.18) !important;
}

:root[data-theme="dark"] .formation-member-count strong {
  color: #bbf7d0 !important;
}

:root[data-theme="dark"] .formation-combat-power {
  border-color: rgba(251, 191, 36, 0.24);
  color: #fef3c7;
  background: linear-gradient(135deg, rgba(112, 75, 20, 0.42), rgba(67, 52, 28, 0.42));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .formation-combat-power small {
  color: rgba(254, 243, 199, 0.68);
}

:root[data-theme="dark"] .formation-combat-power strong {
  color: #fde68a;
}

:root[data-theme="dark"] .formation-combat-power-total {
  border-color: rgba(125, 211, 252, 0.2);
  background: linear-gradient(135deg, rgba(24, 74, 92, 0.46), rgba(34, 55, 59, 0.44));
}

:root[data-theme="dark"] .formation-combat-power-total small {
  color: rgba(207, 235, 246, 0.7);
}

:root[data-theme="dark"] .formation-combat-power-total strong {
  color: #bae6fd;
}

:root[data-theme="dark"] .formation-race-synergy-item {
  color: rgba(238, 247, 242, 0.94) !important;
  border-color: rgba(134, 239, 172, 0.12) !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .formation-race-count {
  color: #dcfce7 !important;
}

:root[data-theme="dark"] .formation-synergy-slot:not(.is-filled),
:root[data-theme="dark"] .formation-race-synergy-list.is-empty {
  border-color: rgba(148, 163, 184, 0.18) !important;
  background: transparent !important;
}

:root[data-theme="dark"] .formation-synergy-personality .formation-synergy-slot:not(.is-filled) {
  border-color: rgba(134, 239, 172, 0.18) !important;
  background: transparent !important;
}

:root[data-theme="dark"] .formation-coin-box,
:root[data-theme="dark"] .formation-coin-owned,
:root[data-theme="dark"] .formation-total-cost,
:root[data-theme="dark"] .formation-coin-remain {
  color: rgba(248, 250, 252, 0.94) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  background: rgba(14, 22, 31, 0.72) !important;
}

:root[data-theme="dark"] .formation-coin-popover {
  border-color: rgba(148, 163, 184, 0.28) !important;
  background: rgba(16, 24, 34, 0.98) !important;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.38) !important;
}

:root[data-theme="dark"] .formation-coin-popover label {
  color: rgba(248, 250, 252, 0.94) !important;
}

:root[data-theme="dark"] .formation-coin-popover input {
  border-color: rgba(148, 163, 184, 0.26) !important;
  color: rgba(248, 250, 252, 0.96) !important;
  background: rgba(8, 13, 18, 0.9) !important;
}

:root[data-theme="dark"] .formation-coin-popover button {
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: rgba(248, 250, 252, 0.92) !important;
  background: rgba(45, 60, 76, 0.9) !important;
}

:root[data-theme="dark"] .formation-coin-owned em {
  color: #9ff4d3;
  background: rgba(45, 212, 191, 0.16);
}

:root[data-theme="dark"] .formation-coin-auto-note {
  color: #fde68a;
  background: rgba(120, 72, 20, 0.42);
}

:root[data-theme="dark"] .formation-coin-display-stroke,
:root[data-theme="dark"] .formation-cost-text-stroke {
  color: rgba(255, 255, 255, 0.98) !important;
  -webkit-text-stroke: 3px rgba(255, 255, 255, 0.98) !important;
}

:root[data-theme="dark"] .formation-coin-display-fill,
:root[data-theme="dark"] .formation-cost-text-fill {
  color: #111 !important;
  -webkit-text-stroke: 0 !important;
}

:root[data-theme="dark"] .formation-apostle-slot.is-filled {
  border-color: color-mix(in srgb, var(--formation-personality-color) 78%, rgba(255, 255, 255, 0.22)) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 48%),
    color-mix(in srgb, var(--formation-personality-color) 58%, rgba(30, 41, 59, 0.58)) !important;
}

:root[data-theme="dark"] .formation-apostle-slot.is-filled:hover:not(:disabled),
:root[data-theme="dark"] .formation-apostle-slot.is-filled:focus-visible {
  border-color: color-mix(in srgb, var(--formation-personality-color) 84%, rgba(255, 255, 255, 0.28)) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), transparent 48%),
    color-mix(in srgb, var(--formation-personality-color) 64%, rgba(30, 41, 59, 0.52)) !important;
}

:root[data-theme="dark"] .formation-apostle-slot.is-filled::before {
  background: transparent !important;
}

:root[data-theme="dark"] .formation-artifact-slot.is-favorite-equipped::before {
  inset: -2px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%,
      rgba(120, 83, 18, 0.92) 0 55%,
      rgba(180, 123, 20, 0.78) 56% 76%,
      rgba(245, 158, 11, 0.44) 77% 100%);
  box-shadow:
    0 0 0 1px rgba(250, 204, 21, 0.5),
    0 0 12px rgba(234, 179, 8, 0.28);
}

:root[data-theme="dark"] .formation-artifact-slot.is-favorite-equipped::after {
  inset: -2px;
  border: 2px solid rgba(250, 204, 21, 0.78);
  border-radius: 50%;
  background: transparent;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 0 10px rgba(234, 179, 8, 0.28);
}

:root[data-theme="dark"] .formation-spell-card,
:root[data-theme="dark"] .formation-spell-selected-card {
  border-color: color-mix(in srgb, var(--formation-spell-color) 76%, rgba(255, 255, 255, 0.2)) !important;
  background: rgba(15, 23, 42, 0.78) !important;
  box-shadow: 0 5px 12px var(--formation-spell-glow) !important;
}

:root[data-theme="dark"] .formation-spell-card-art {
  border-color: color-mix(in srgb, var(--formation-spell-color) 62%, rgba(255, 255, 255, 0.18)) !important;
  background: color-mix(in srgb, var(--formation-spell-color) 20%, rgba(15, 23, 42, 0.78)) !important;
}

:root[data-theme="dark"] .formation-spell-name,
:root[data-theme="dark"] .formation-spell-head {
  color: rgba(248, 250, 252, 0.94) !important;
}

:root[data-theme="dark"] .equipment-bulk-actions summary,
:root[data-theme="dark"] .equipment-bulk-menu,
:root[data-theme="dark"] .equipment-bulk-menu button {
  color: rgba(248, 250, 252, 0.95) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  background: rgba(8, 13, 18, 0.58) !important;
}

:root[data-theme="dark"] .rank-inline-control {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .equipment-bulk-actions[open] summary,
:root[data-theme="dark"] .equipment-bulk-menu button:hover:not(:disabled) {
  border-color: rgba(196, 181, 253, 0.38) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

:root[data-theme="dark"] .rank-inline-control select {
  color-scheme: dark !important;
  color: rgba(248, 250, 252, 0.98) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  background: rgba(8, 13, 18, 0.58) !important;
}

:root[data-theme="dark"] .board-global-ratio-layer-1,
:root[data-theme="dark"] .board-global-stat-matrix-1 {
  background-color: #102f24 !important;
}

:root[data-theme="dark"] .board-global-ratio-layer-2,
:root[data-theme="dark"] .board-global-stat-matrix-2 {
  background-color: #17294f !important;
}

:root[data-theme="dark"] .board-global-ratio-layer-3,
:root[data-theme="dark"] .board-global-stat-matrix-3 {
  background-color: #321d4c !important;
}

:root[data-theme="dark"] button.history-floating-button {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(22, 31, 34, 0.94);
  color: rgba(238, 247, 242, 0.94);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] button.history-floating-button:hover:not(:disabled),
:root[data-theme="dark"] button.history-floating-button:focus-visible:not(:disabled) {
  border-color: rgba(134, 239, 172, 0.42);
  background: rgba(36, 52, 58, 0.98);
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] button.history-floating-button:disabled:hover {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(44, 52, 58, 0.88);
  color: rgba(148, 163, 184, 0.82);
}

:root[data-theme="dark"] button.history-floating-button:focus-visible:not(:disabled) {
  border-color: rgba(134, 239, 172, 0.5);
}
:root[data-theme="dark"] button.history-floating-button:disabled {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(44, 52, 58, 0.88);
  color: rgba(148, 163, 184, 0.82);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

@media (max-width: 520px) {
  .formation-artifact-list {
    grid-template-columns: repeat(3, 27px);
    gap: 1px;
    justify-content: center;
  }

  .formation-artifact-slot {
    width: 27px;
    height: 27px;
  }

  .formation-artifact-slot .formation-empty-icon {
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
  }

  .formation-artifact-slot.is-favorite-equipped::before,
  .formation-artifact-slot.is-favorite-equipped::after {
    inset: -2px;
  }

  .formation-artifact-slot .formation-cost-badge {
    right: -2px;
    bottom: -3px;
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 360px) {
  .formation-artifact-list {
    grid-template-columns: repeat(3, 25px);
  }

  .formation-artifact-slot {
    width: 25px;
    height: 25px;
  }

  .formation-artifact-slot .formation-empty-icon {
    font-size: 0.62rem;
  }
}

/* Compact the global-board controls beside history buttons on narrow screens. */
@media (max-width: 420px) {
  .dashboard-bottom-bar {
    display: grid;
    width: 100vw;
    width: 100dvw;
    max-width: 100dvw;
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1.35fr) repeat(5, minmax(0, 1fr)) minmax(0, 1fr);
    gap: 1px;
    padding-right: max(2px, env(safe-area-inset-right));
    padding-left: max(2px, env(safe-area-inset-left));
    justify-content: stretch;
  }

  .dashboard-bottom-bar > button,
  .dashboard-bottom-bar > details,
  .bottom-save-menu summary.bottom-save-trigger {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .bottom-apostle-button {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex-basis: auto;
    justify-content: center;
    gap: 1px;
    padding: 1px !important;
  }

  .bottom-apostle-button img {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 9px;
  }

  .bottom-apostle-button span {
    flex: 0 1 auto;
    gap: 0;
  }

  .bottom-apostle-button small {
    font-size: 0;
  }

  .bottom-apostle-button small::after {
    content: "使徒\A選択";
    font-size: 0.46rem;
    line-height: 1.05;
    white-space: pre;
  }

  .bottom-apostle-button strong {
    display: none;
  }

  .board-quick-button,
  .card-quick-button,
  .bottom-section-button,
  .bottom-save-menu summary.bottom-save-trigger {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex-basis: auto;
    grid-template-rows: 22px minmax(0, 1fr);
  }

  .bottom-section-icon {
    display: grid;
    width: 21px;
    height: 21px;
    flex-basis: 21px;
    border-width: 1px;
  }

  .bottom-section-icon img {
    width: 17px;
    height: 17px;
  }

  .bottom-section-button strong,
  .bottom-save-trigger strong,
  .bottom-save-trigger strong span[data-compact-label]::after {
    font-size: 0.48rem;
    line-height: 0.9;
  }

  .board-global-floating-dock {
    right: 96px;
    left: auto;
    bottom: calc(var(--dashboard-bar-height, 44px) + 12px);
    gap: 2px;
    max-width: calc(100vw - 104px);
    transform: none;
  }

  .board-global-floating-mode button {
    min-width: 24px;
    padding-inline: 1px;
    font-size: 0.62rem;
  }

  .board-global-shortcut-off-toggle {
    padding-inline: 0;
    font-size: 0;
  }

  .board-global-shortcut-off-toggle::after {
    content: "OFF:マス";
    font-size: 0.64rem;
  }

  .board-global-shortcut-off-toggle.is-route::after {
    content: "OFF:経路";
  }
}

.board-off-mode-dialog {
  width: min(520px, calc(100vw - 24px));
  box-sizing: border-box;
  border: 1px solid rgba(36, 83, 59, 0.22);
  border-radius: 22px;
  padding: 18px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.98);
  box-shadow: 0 24px 70px rgba(25, 47, 31, 0.3);
}

.board-off-mode-dialog::backdrop {
  background: rgba(18, 30, 22, 0.58);
  backdrop-filter: blur(3px);
}

.board-off-mode-head {
  display: grid;
  gap: 6px;
}

.board-off-mode-kicker {
  color: #3976a8;
  font-size: 0.68rem;
  font-weight: 950;
}

.board-off-mode-head h2,
.board-off-mode-head p,
.board-off-mode-options p {
  margin: 0;
}

.board-off-mode-head h2 {
  font-size: 1.05rem;
}

.board-off-mode-head p,
.board-off-mode-options p {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.65;
}

.board-off-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.board-off-mode-options article {
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid rgba(36, 83, 59, 0.15);
  border-radius: 14px;
  padding: 11px;
  background: rgba(62, 119, 84, 0.05);
}

.board-off-mode-options article.is-current {
  opacity: 0.72;
}

.board-off-mode-options article.is-next {
  border-color: rgba(57, 118, 168, 0.52);
  background: rgba(57, 118, 168, 0.1);
  box-shadow: inset 0 0 0 1px rgba(57, 118, 168, 0.12);
}

.board-off-mode-options article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.board-off-mode-options strong {
  font-size: 0.86rem;
}

.board-off-mode-options [data-board-off-mode-badge] {
  border-radius: 999px;
  padding: 2px 7px;
  color: #456050;
  background: rgba(62, 119, 84, 0.12);
  font-size: 0.62rem;
  font-weight: 950;
}

.board-off-mode-options .is-next [data-board-off-mode-badge] {
  color: #fff;
  background: #3976a8;
}

.board-off-mode-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.board-off-mode-actions button {
  min-height: 38px;
  border: 1px solid rgba(36, 83, 59, 0.2);
  border-radius: 11px;
  padding: 0 14px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.74rem;
  font-weight: 950;
  cursor: pointer;
}

.board-off-mode-actions button.primary {
  color: #fff;
  border-color: #3976a8;
  background: #3976a8;
}

:root[data-theme="dark"] .board-off-mode-dialog {
  border-color: rgba(166, 180, 197, 0.24);
  background: rgba(14, 24, 38, 0.98);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.58);
}

:root[data-theme="dark"] .board-off-mode-options article {
  border-color: rgba(166, 180, 197, 0.18);
  background: rgba(20, 34, 52, 0.82);
}

:root[data-theme="dark"] .board-off-mode-options article.is-next {
  border-color: rgba(129, 140, 248, 0.62);
  background: rgba(99, 102, 241, 0.16);
}

@media (max-width: 520px) {
  .dashboard-page .panel-note {
    font-size: 0.75rem;
    line-height: 1.55;
  }

  .card-manager-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
  }

  .card-manager-tabs {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    box-sizing: border-box;
    padding: 2px;
  }

  .card-manager-tabs button {
    min-width: 0;
    flex: 1;
    padding-inline: 2px;
    font-size: 0.7rem;
    white-space: nowrap;
  }

  .card-manager-owned-filter {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    padding-inline: 6px;
  }

  .card-manager-search {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-height: 34px;
    box-sizing: border-box;
    padding-inline: 8px;
  }

  .card-manager-search > span {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .card-manager-select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 3px;
    padding-inline: 6px;
    font-size: 0.68rem;
  }

  .card-manager-select select {
    min-width: 0;
    flex: 1;
    font-size: 0.68rem;
  }

  .card-manager-bulk-tools {
    display: contents;
  }

  .card-manager-bulk-tools > button {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 32px;
    padding-inline: 8px;
  }

  .apostle-picker-dialog {
    max-width: calc(100vw - 10px);
  }

  .apostle-picker-card .apostle-info-badge.overlay {
    width: 21px;
    height: 21px;
    border-radius: 6px;
  }

  .apostle-picker-card .apostle-info-badge.personality.overlay {
    top: 4px;
    left: 4px;
  }

  .apostle-picker-card .apostle-info-badge.species.overlay {
    top: 28px;
    left: 4px;
    width: 20px;
    height: 20px;
  }

  .apostle-picker-card .apostle-info-badge.role.overlay {
    top: 51px;
    left: 4px;
  }

  .apostle-picker-card .apostle-info-badge.position.overlay {
    top: 51px;
    right: 4px;
  }

  .apostle-picker-card .apostle-picker-follow-icon {
    top: 3px;
    right: 3px;
    width: 25px;
    height: 25px;
  }

  .apostle-picker-card .apostle-picker-stars {
    height: 15px;
    margin-top: -8px;
  }

  .apostle-picker-card .apostle-picker-stars img {
    width: 16px;
    height: 16px;
  }

  .rank-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    padding-right: 0;
  }

  .rank-overview-card {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 2px 5px;
    min-width: 0;
    border-radius: 11px;
    padding: 5px;
  }

  .rank-overview-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .aside-overview-card .rank-overview-icon {
    transform: scale(1.1);
  }

  .rank-overview-name {
    min-width: 0;
    font-size: 0.66rem;
  }

  .rank-overview-value {
    min-width: 0;
    overflow: hidden;
    font-size: 0.65rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bond-overview-value small {
    margin-left: 0.15rem;
    font-size: 0.56rem;
  }

  .board-off-mode-dialog {
    width: calc(100vw - 16px);
    border-radius: 18px;
    padding: 14px;
  }

  .board-off-mode-options {
    grid-template-columns: 1fr;
  }

  .board-off-mode-actions button {
    flex: 1;
    padding-inline: 8px;
  }
}
/* Keep compact selects readable on Android browsers with wide native arrows. */
:root body.dashboard-page :is(
  .apostle-bulk-field select,
  .apostle-bulk-group select,
  .dashboard-persistent-profile .profile-meta-select,
  .dashboard-persistent-profile .profile-skill-levels select,
  .dashboard-persistent-profile .profile-equipment-chip select
) {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'%3E%3Cpath d='M1 1.25 4 4.25 7 1.25' fill='none' stroke='%2364756b' stroke-width='1.35' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-position: calc(100% - 3px) 50% !important;
  background-size: 8px 6px !important;
  background-repeat: no-repeat !important;
}

.apostle-bulk-field select,
.apostle-bulk-group select {
  padding-right: 11px;
  padding-left: 4px;
}

:root[data-theme="dark"] body.dashboard-page :is(
  .apostle-bulk-field select,
  .apostle-bulk-group select,
  .dashboard-persistent-profile .profile-meta-select,
  .dashboard-persistent-profile .profile-skill-levels select,
  .dashboard-persistent-profile .profile-equipment-chip select
) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'%3E%3Cpath d='M1 1.25 4 4.25 7 1.25' fill='none' stroke='%23cbd5e1' stroke-width='1.35' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}

.dashboard-persistent-profile .profile-meta-select {
  padding-right: 12px;
}

.dashboard-persistent-profile .profile-skill-levels select {
  padding-right: 10px;
  padding-left: 3px;
}

.dashboard-persistent-profile .profile-equipment-chip select {
  padding-right: 11px;
  padding-left: 3px;
}

@media (max-width: 480px) {
  .apostle-bulk-equipments {
    gap: 2px;
  }

  .apostle-bulk-equipments .apostle-bulk-group-title {
    min-width: 24px;
    padding-inline: 1px;
  }

  .apostle-bulk-equipment select {
    padding-right: 8px;
    padding-left: 2px;
    font-size: 0.66rem;
    background-position: calc(100% - 1px) 50% !important;
  }
}
