:root {
  color-scheme: light;
  --bg: #edf1f5;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --ink: #101318;
  --muted: #667085;
  --soft: #8a95a6;
  --line: #d7dee8;
  --line-strong: #b9c4d2;
  --dark: #10141b;
  --dark-2: #181d26;
  --yellow: #f6c945;
  --yellow-2: #ffe58a;
  --blue: #2f7df6;
  --cyan: #00a6b4;
  --green: #15803d;
  --red: #b42318;
  --accent: #2f7df6;
  --blue-soft: #edf5ff;
  --text: #101318;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 15px;
  --text-xl: 17px;
  --text-2xl: 20px;
  --text-3xl: 22px;
  --text-4xl: 26px;
  --shadow: 0 10px 30px rgba(16, 19, 24, 0.08);
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--soft);
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(135deg, rgba(16, 20, 27, 0.04) 25%, transparent 25%) 0 0 / 28px 28px,
    linear-gradient(225deg, rgba(16, 20, 27, 0.035) 25%, transparent 25%) 0 0 / 28px 28px,
    var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px 14px;
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(246, 201, 69, 0.12), transparent 48%),
    var(--dark);
  color: #f4f7fb;
  border-right: 4px solid var(--yellow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--yellow);
  box-shadow: 0 0 0 1px rgba(246, 201, 69, 0.24);
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.brand-sub {
  margin-top: 4px;
  color: #aeb8c6;
  font-size: 12px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
}

.nav-item {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #d9e0ea;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-item:hover,
.nav-item.active {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--ink);
  font-weight: 700;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 18px;
}

.mini-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(246, 201, 69, 0.5);
  border-radius: 6px;
  background: rgba(246, 201, 69, 0.12);
  color: var(--yellow-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.mini-chip[data-tone="success"] {
  border-color: rgba(34, 197, 94, 0.52);
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.mini-chip[data-tone="error"] {
  border-color: rgba(248, 113, 113, 0.52);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

.mini-note {
  margin-top: 10px;
  color: #9aa6b6;
  font-size: 12px;
}

.content {
  min-width: 0;
  padding: 24px 28px 48px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.title-block {
  min-width: 0;
}

.eyebrow {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.title-block h1 {
  margin: 4px 0 4px;
  font-size: var(--text-4xl);
  line-height: 1.2;
}

.title-block p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.primary-btn,
.ghost-btn {
  min-height: 36px;
  border-radius: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  font-weight: 700;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.primary-btn {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 125, 246, 0.22);
}

.primary-btn:hover {
  background: #1f6be4;
  box-shadow: 0 8px 20px rgba(47, 125, 246, 0.3);
}

.primary-btn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(47, 125, 246, 0.2);
}

.ghost-btn {
  background: #fff;
  color: var(--ink);
}

.ghost-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.danger-btn {
  min-height: 36px;
  border: 1px solid #f3b6ad;
  border-radius: 6px;
  padding: 8px 14px;
  background: #fff5f3;
  color: var(--red);
  font-weight: 800;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.danger-btn:hover {
  border-color: var(--red);
}

.danger-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.compact-btn {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #cfe1ff;
  border-radius: 6px;
  background: #f2f7ff;
  color: #285da8;
  font-size: 12px;
  font-weight: 800;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.compact-btn.danger-lite {
  border-color: #f3b6ad;
  background: #fff5f3;
  color: var(--red);
}

.compact-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.page-notice-host {
  margin: 14px 0 0;
}

.page-notice {
  --notice-accent: var(--blue);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 13px 12px 13px 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--notice-accent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  animation: notice-enter 0.2s ease;
}

@keyframes notice-enter {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-notice-success {
  --notice-accent: var(--green);
}

.page-notice-error {
  --notice-accent: var(--red);
}

.page-notice-warning {
  --notice-accent: #b7791f;
}

.page-notice-body {
  min-width: 0;
}

.page-notice-body strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.page-notice-body p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.page-notice-actions .primary-btn,
.page-notice-actions .ghost-btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.page-notice-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--soft);
}

.page-notice-close .icon {
  width: 16px;
  height: 16px;
}

.page-notice-close:hover {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--ink);
}

.hero-strip {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(420px, 1.4fr);
  gap: 14px;
  align-items: stretch;
  margin: 16px 0;
  border: 1px solid #c8d1dd;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(246, 201, 69, 0.96) 0 6px, transparent 6px),
    repeating-linear-gradient(135deg, rgba(16, 19, 24, 0.05) 0 1px, transparent 1px 11px),
    #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 16px 18px 16px 22px;
}

.hero-media {
  width: 86px;
  height: 86px;
  flex: 0 0 auto;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(246, 201, 69, 0.2), transparent 54%),
    #10141b;
  border: 1px solid rgba(16, 19, 24, 0.16);
  overflow: hidden;
}

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

.hero-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hero-title {
  margin-top: 3px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-left: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.72);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 96px;
  padding: 14px;
  border-left: 1px solid rgba(215, 222, 232, 0.85);
}

.hero-stat:first-child {
  border-left: 0;
}

.hero-stat span {
  color: var(--muted);
  font-size: 12px;
}

.hero-stat strong {
  margin-top: 6px;
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.hero-stat small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(520px, 1.03fr) minmax(440px, 0.97fr);
  gap: 18px;
  align-items: start;
}

.config-column,
.result-column {
  min-width: 0;
}

.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head h2 {
  margin: 0;
  font-size: var(--text-xl);
  line-height: 1.25;
}

.card h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 800;
}

.tag {
  flex: 0 1 auto;
  max-width: 58%;
  padding: 5px 8px;
  border: 1px solid #cfe1ff;
  border-radius: 6px;
  background: #f2f7ff;
  color: #285da8;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entity-preview {
  position: relative;
  grid-row: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 146px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    repeating-linear-gradient(135deg, rgba(16, 19, 24, 0.06) 0 1px, transparent 1px 12px),
    #10141b;
}

.entity-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(246, 201, 69, 0.18), transparent 58%);
}

.entity-preview img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 146px;
  object-fit: contain;
  object-position: center bottom;
}

.weapon-preview img {
  width: 82%;
  height: 132px;
  object-position: center;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 700;
}

.field select,
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field select,
.field input {
  min-height: 38px;
  padding: 7px 10px;
}

.field input:disabled,
.field select:disabled {
  color: #697386;
  background: #f3f6fa;
}

.field textarea {
  min-height: 330px;
  resize: vertical;
  padding: 11px;
  font-family: "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.native-image-select {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0 !important;
}

.image-select {
  position: relative;
  min-width: 0;
}

.image-select-trigger {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 12px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  gap: 8px;
  padding: 5px 10px 5px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.image-select-trigger:focus-visible {
  outline: 2px solid rgba(47, 125, 246, 0.18);
  border-color: var(--blue);
}

.image-select-trigger-icon,
.image-select-option-icon {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.image-select-icon-fallback {
  border-radius: 6px;
  background: var(--panel-2);
}

.image-select-trigger-label,
.image-select-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-select-trigger-label {
  color: var(--ink);
}

.image-select-chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.16s ease;
}

.image-select.open .image-select-chevron {
  transform: rotate(225deg) translateY(-2px);
}

.image-select-list {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: min(320px, 52vh);
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(16, 19, 24, 0.18);
}

.image-select.open .image-select-list {
  display: grid;
  gap: 2px;
}

.image-select-option {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 42px;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.image-select-option-icon {
  width: 36px;
  height: 36px;
}

.image-select-option:hover,
.image-select-option.active {
  background: #f4f8ff;
}

.image-select-option.selected {
  color: var(--blue);
  font-weight: 800;
}

.field select:focus,
.field input:focus,
.field textarea:focus {
  outline: 2px solid rgba(47, 125, 246, 0.2);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 125, 246, 0.12);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.stat-chip {
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.stat-chip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat-chip strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.weapon-effect {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(246, 201, 69, 0.14), transparent 54%),
    #fff;
}

.weapon-effect-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.weapon-effect-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.weapon-effect-head strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.25;
  text-align: right;
  overflow-wrap: anywhere;
}

.weapon-effect-body {
  padding: 10px 11px 11px;
}

.weapon-effect-body p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.weapon-effect-body p + p {
  margin-top: 7px;
}

.weapon-effect-requirement {
  color: var(--muted) !important;
  font-weight: 800;
}

.weapon-effect-buff {
  color: var(--green) !important;
  font-weight: 800;
}

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

.disc-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.disc-picker-field select {
  overflow: hidden;
  text-overflow: ellipsis;
}

.disc-card {
  position: relative;
  min-height: 126px;
  padding: 10px 10px 10px 12px;
  overflow: hidden;
  border: 1px dashed #b8d7ff;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(47, 125, 246, 0.06), transparent 44%),
    #f8fbff;
}

.disc-card.filled {
  border-style: solid;
  border-color: #b9cde8;
  background:
    linear-gradient(135deg, rgba(246, 201, 69, 0.16), transparent 48%),
    #ffffff;
}

.disc-card.filled::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--yellow);
}

.disc-slot {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.disc-set {
  margin-top: 6px;
  min-height: 36px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.disc-main {
  margin-top: 7px;
  color: var(--ink);
  font-size: 13px;
}

.disc-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.panel-band {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.score-card {
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px;
  border: 1px solid #e0c453;
  border-radius: 8px;
  background:
    repeating-linear-gradient(135deg, rgba(16, 19, 24, 0.07) 0 1px, transparent 1px 10px),
    var(--yellow);
  color: var(--ink);
}

.score-card span {
  font-size: 12px;
  font-weight: 800;
}

.score-card strong {
  margin-top: 8px;
  font-size: 30px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.panel-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.summary-item {
  min-height: 59px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-item strong {
  display: block;
  margin-top: 6px;
  font-size: 17px;
  line-height: 1.2;
}

.collapsible-card > .card-head {
  cursor: pointer;
  user-select: none;
}

.collapsible-card > .card-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.collapsible-card > .card-head h2::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 2px;
  vertical-align: -1px;
  background: var(--blue);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") center/contain no-repeat;
  transition: transform 0.18s ease;
}

.collapsible-card.collapsed > .card-head h2::before {
  transform: rotate(-90deg);
}

.collapsible-card.collapsed > .collapsible-body {
  display: none;
}

.collapsible-body > .kv-section:first-child {
  margin-top: 0;
}

.kv-section {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.kv-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: var(--text-sm);
}

.kv-row span {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.kv-row strong {
  flex: 0 0 auto;
  text-align: right;
}

.kv-row.highlighted {
  border-color: #e1b72d;
  background:
    linear-gradient(90deg, rgba(246, 201, 69, 0.22), transparent 72%),
    #fffdf1;
  box-shadow: inset 4px 0 0 var(--yellow);
}

.kv-row.highlighted span,
.kv-row.highlighted strong {
  color: #05070a;
  font-weight: 900;
}

.kv-row.highlighted strong {
  font-size: 15px;
}

.breakdown-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.breakdown-details summary {
  min-height: 42px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--panel-2);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.breakdown-grid {
  padding: 0 12px 12px;
}

.breakdown-grid .kv-section:first-child {
  margin-top: 0;
}

.split-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item,
.empty {
  min-height: 38px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.list-item.good {
  border-color: #bbdfc8;
  background: #f2fbf5;
  color: var(--green);
}

.list-item.muted,
.empty {
  color: var(--muted);
}

.combat-section-grid {
  display: grid;
  gap: 14px;
}

.combat-group {
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.combat-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.combat-buff-list {
  display: grid;
  gap: 8px;
}

.target-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.target-settings-grid .target-resistance-field {
  grid-column: 1 / -1;
}

.target-stun-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.target-stun-check:has(input:checked) {
  border-color: #a8cef8;
  background: #f8fbff;
}

.target-stun-check input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.target-stun-check span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.target-resistance-field {
  gap: 8px;
}

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

.resistance-buttons button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.resistance-buttons button:hover,
.resistance-buttons button.active {
  border-color: var(--blue);
  background: #edf5ff;
  color: var(--blue);
}

.resistance-custom-control[hidden] {
  display: none;
}

.resistance-custom-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.resistance-custom-control select,
.resistance-custom-control input {
  min-height: 36px;
}

.resistance-custom-unit {
  color: var(--muted);
  font-weight: 900;
}

.combat-check-row {
  display: grid;
  gap: 8px;
  align-items: start;
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.combat-check-row.active {
  border-color: #a8cef8;
  background: #f8fbff;
}

.combat-check-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.combat-check-toggle > input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.combat-check-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.combat-check-copy strong,
.combat-check-copy span {
  display: block;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.combat-check-copy strong {
  font-size: 13px;
  line-height: 1.3;
}

.combat-check-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.combat-team-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.combat-team-group h4 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.combat-team-head,
.combat-team-current {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.combat-team-current {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.combat-team-avatar {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.combat-team-avatar.empty {
  box-shadow: inset 0 0 0 2px #d7dee9;
}

.combat-team-head-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.combat-team-head-copy strong,
.combat-team-head-copy span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.combat-team-head-copy strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}

.combat-team-head-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.teammate-buff-row {
  background: #fff;
}

.combat-check-copy .combat-check-description {
  color: var(--muted);
}

.combat-buff-effect-lines,
.combat-check-copy .combat-check-stats,
.combat-check-copy .combat-check-stats > span,
.combat-added-card .combat-added-stats {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.combat-check-stats > span,
.combat-added-stats > span,
.combat-buff-effect-lines > span {
  display: block;
}

.combat-add-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.combat-add-head h3 {
  margin: 0;
}

.icon-add-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #d8e6f8;
  border-radius: 50%;
  background: #f3f8ff;
  color: var(--blue);
}

.combat-added-list {
  display: grid;
  gap: 8px;
}

.combat-added-source-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--combat-source-border, var(--line));
  border-radius: 8px;
  background: var(--combat-source-bg, #fff);
  box-shadow: 0 8px 20px rgba(16, 19, 24, 0.045);
}

.combat-added-source-group--agent-1 {
  --combat-source-bg: #f7fbff;
  --combat-source-border: #b8d8fb;
  --combat-source-accent: #2f7df6;
}

.combat-added-source-group--agent-2 {
  --combat-source-bg: #f7fcf8;
  --combat-source-border: #acdcbc;
  --combat-source-accent: #208a4d;
}

.combat-added-source-group--wEngine {
  --combat-source-bg: #fff9ec;
  --combat-source-border: #efd088;
  --combat-source-accent: #b7791f;
}

.combat-added-source-group--driveDisc {
  --combat-source-bg: #f8f6ff;
  --combat-source-border: #c8bcf3;
  --combat-source-accent: #6554c0;
}

.combat-added-source-group--custom {
  --combat-source-bg: #fff7f7;
  --combat-source-border: #efb6b6;
  --combat-source-accent: #c44949;
}

.combat-added-source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.combat-added-source-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.combat-added-source-head small,
.combat-added-source-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.combat-added-source-head small {
  color: var(--combat-source-accent, var(--muted));
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
}

.combat-added-source-head strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.combat-remove-group-btn {
  min-height: 28px;
  border: 1px solid var(--combat-source-border, var(--line));
  border-radius: 6px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--combat-source-accent, var(--muted));
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.combat-remove-group-btn:hover {
  background: #fff;
  box-shadow: 0 8px 18px rgba(16, 19, 24, 0.08);
}

.combat-added-source-items {
  display: grid;
  gap: 8px;
}

.combat-added-card {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 10px 78px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.combat-added-item-card {
  border-color: rgba(16, 19, 24, 0.08);
  box-shadow: none;
}

.combat-select-card {
  padding-right: 12px;
}

.combat-select-card.active {
  border-color: #a8cef8;
  background: #f8fbff;
}

.combat-select-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.combat-select-toggle input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.combat-added-card strong,
.combat-added-card span,
.combat-added-card p {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.combat-added-card > span,
.combat-added-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.combat-added-card .combat-added-stats,
.combat-added-card .combat-added-stats > span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.combat-runtime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.combat-runtime-effect-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.combat-runtime-effect-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.combat-runtime-toggle-field {
  align-content: start;
}

.damage-result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #bfd8f3;
  border-radius: 8px;
  background: #f3f8ff;
}

.damage-result-head span {
  color: var(--muted);
  font-size: 13px;
}

.damage-result-head strong {
  color: var(--blue);
  font-size: 26px;
  line-height: 1.1;
}

.damage-whitebox-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.damage-whitebox-panel {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.damage-whitebox-panel > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 13px;
}

.damage-whitebox-panel > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
}

.damage-whitebox-panel span {
  color: var(--muted);
  font-size: 12px;
}

.damage-whitebox-panel b {
  color: var(--ink);
  font-size: 12px;
  text-align: right;
}

.damage-whitebox-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.damage-whitebox-row div {
  min-width: 0;
}

.damage-whitebox-row strong,
.damage-whitebox-row span {
  overflow-wrap: anywhere;
}

.damage-whitebox-row div strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.damage-whitebox-row div span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.damage-whitebox-row > strong {
  color: var(--blue);
  font-size: 14px;
}

.combat-remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 28px;
  border: 1px solid #f3b6ad;
  border-radius: 6px;
  padding: 4px 8px;
  background: #fff5f3;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.teammate-disc-selects,
.combat-manual-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.teammate-disc-selects {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.damage-skill-picker-field {
  gap: 8px;
}

.damage-skill-picker-field .ghost-btn {
  width: fit-content;
}

.damage-skill-picker-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.damage-skill-level-field {
  grid-column: 1 / -1;
}

.damage-skill-level-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.skill-level-chip {
  display: inline-grid;
  grid-template-columns: minmax(72px, auto) minmax(86px, 108px);
  gap: 8px;
  align-items: center;
  min-height: 38px;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.skill-level-chip span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.skill-level-chip select {
  min-height: 30px;
}

.disc-modal.combat-buff-modal {
  width: min(920px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(16, 20, 27, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
}

.disc-modal.calculation-config-modal {
  width: min(980px, calc(100vw - 32px));
}

.calculation-config-summary {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(16, 20, 27, 0.08);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.calculation-objective-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.calculation-objective-grid .damage-skill-picker-field {
  grid-column: 1 / -1;
}

.calculation-config-top {
  margin-bottom: 16px;
}

.calculation-config-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.35fr);
  gap: 14px;
  min-height: min(58vh, 560px);
}

.calculation-event-sidebar,
.calculation-event-editor {
  min-width: 0;
  border: 1px solid rgba(16, 20, 27, 0.08);
  border-radius: 8px;
  background: #fff;
}

.calculation-event-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.calculation-event-sidebar-head,
.calculation-event-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.calculation-event-sidebar-head strong,
.calculation-event-editor-head strong {
  color: var(--ink);
  font-size: 14px;
}

.calculation-event-sidebar-head span,
.calculation-event-editor-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calculation-config-event-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.calculation-event-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(16, 20, 27, 0.08);
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.calculation-event-list-item.active {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(95, 120, 255, 0.16);
}

.calculation-event-select {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.calculation-event-order {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 6px;
  background: rgba(47, 94, 255, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.calculation-event-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.calculation-event-copy strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.calculation-event-copy small {
  color: var(--muted);
  font-size: 12px;
}

.calculation-event-inline-actions,
.calculation-event-editor-actions,
.calculation-add-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.calculation-event-inline-actions .compact-btn {
  min-height: 30px;
  padding: 5px 8px;
}

.calculation-add-actions {
  justify-content: stretch;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.calculation-add-actions .compact-btn {
  flex: 1 1 72px;
}

.calculation-event-editor {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.calculation-event-editor-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.calculation-event-editor-head strong {
  overflow-wrap: anywhere;
}

.calculation-event-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.calculation-default-event-list-item {
  grid-template-columns: minmax(0, 1fr);
  background: #fff;
}

.calculation-default-event-list-item.active {
  border-color: var(--accent);
  background: #fbfdff;
  box-shadow: 0 0 0 1px rgba(95, 120, 255, 0.12);
}

.calculation-default-event-list .calculation-event-select {
  width: 100%;
}

.calculation-default-event-detail {
  background: #fff;
}

.calculation-default-detail-grid {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.calculation-default-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.calculation-default-detail-item {
  min-width: 0;
  border: 1px solid rgba(16, 20, 27, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
}

.calculation-default-detail-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calculation-default-detail-item strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.calculation-event-editor-empty,
.calculation-event-empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.calculation-config-footer {
  position: sticky;
  bottom: 0;
  justify-content: space-between;
  margin: 14px -2px -2px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.calculation-config-footer span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.mini-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.damage-event-breakdown {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.damage-event-breakdown button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(16, 20, 27, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.damage-event-breakdown button > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.damage-event-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.damage-event-breakdown button.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(95, 120, 255, 0.18);
}

.combat-buff-modal .modal-head {
  top: 0;
  margin: 0;
  align-items: center;
  min-height: 94px;
  padding: 22px 58px 20px 24px;
  background:
    linear-gradient(135deg, rgba(246, 201, 69, 0.18), transparent 44%),
    linear-gradient(90deg, #111722, #1c2634);
  border-bottom: 3px solid var(--yellow);
  color: #fff;
}

.combat-buff-modal .modal-head h2 {
  font-size: 22px;
}

.combat-buff-modal .modal-head p {
  color: #cbd5e1;
}

.combat-buff-modal .modal-close {
  top: 18px;
  right: 18px;
  color: #d7dde7;
}

.combat-buff-modal .modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.combat-buff-search-field {
  margin: 18px 24px 0;
}

.combat-buff-search-field input {
  min-height: 42px;
  border-radius: 8px;
  background: #fff;
}

.combat-buff-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 24px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f8;
}

.combat-buff-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.combat-buff-tabs button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 6px 16px rgba(16, 19, 24, 0.08);
}

.combat-buff-teammate-picker {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px 12px;
  align-items: end;
  margin: 14px 24px 0;
  padding: 12px;
  border: 1px solid #d8e6f8;
  border-radius: 8px;
  background: #f8fbff;
}

.combat-buff-teammate-picker[hidden] {
  display: none;
}

.combat-buff-teammate-picker .field {
  margin: 0;
}

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

.combat-buff-bulk-actions .compact-btn {
  min-height: 34px;
  white-space: nowrap;
}

.combat-buff-teammate-picker small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.combat-buff-candidate-list {
  display: grid;
  gap: 9px;
  max-height: min(500px, calc(100vh - 340px));
  margin: 16px 24px 24px;
  padding-right: 2px;
  overflow: auto;
}

.combat-candidate-row {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 82px;
  padding: 13px 14px 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 18px rgba(16, 19, 24, 0.045);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.combat-candidate-row:hover:not(:disabled) {
  border-color: var(--blue);
  background: linear-gradient(90deg, #f8fbff, #fff);
  box-shadow: 0 12px 26px rgba(47, 125, 246, 0.12);
}

.combat-candidate-row.active {
  border-color: #2f7df6;
  background: #f2f7ff;
}

.combat-candidate-row strong {
  font-size: 14px;
  line-height: 1.35;
}

.combat-candidate-row:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.combat-candidate-row.disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.combat-candidate-check-row {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  min-height: 0;
  cursor: pointer;
}

.combat-candidate-check-row.active {
  border-color: #a8cef8;
  background: #f8fbff;
}

.combat-candidate-check-row input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.combat-candidate-check-row input:disabled {
  cursor: not-allowed;
}

.combat-candidate-check-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.combat-candidate-check-copy strong,
.combat-candidate-check-copy span,
.combat-candidate-check-copy p {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.combat-candidate-row span,
.combat-candidate-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.combat-candidate-row .combat-buff-effect-lines,
.combat-candidate-row .combat-buff-effect-lines > span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.combat-custom-pane {
  display: grid;
  gap: 14px;
  margin: 16px 24px 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(47, 125, 246, 0.06), transparent 46%),
    #fff;
  box-shadow: 0 10px 24px rgba(16, 19, 24, 0.06);
}

.disc-modal.damage-skill-modal {
  width: min(860px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(16, 20, 27, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.damage-skill-modal .modal-head {
  top: 0;
  margin: 0;
  align-items: center;
  min-height: 88px;
  padding: 20px 58px 18px 24px;
  background:
    linear-gradient(135deg, rgba(246, 201, 69, 0.16), transparent 44%),
    linear-gradient(90deg, #111722, #1c2634);
  border-bottom: 3px solid var(--yellow);
  color: #fff;
}

.damage-skill-modal .modal-head h2 {
  font-size: 22px;
}

.damage-skill-modal .modal-head p {
  color: #cbd5e1;
}

.damage-skill-search-field {
  margin: 18px 24px 0;
}

.damage-skill-search-field input {
  min-height: 42px;
  border-radius: 8px;
}

.damage-skill-modal .modal-close {
  top: 18px;
  right: 18px;
  color: #d7dde7;
}

.damage-skill-modal-list {
  height: min(560px, calc(100vh - 260px));
  min-height: min(420px, calc(100vh - 260px));
  margin: 18px 24px 24px;
  overflow: hidden;
}

.damage-skill-cascade {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.damage-skill-move-pane {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.damage-skill-row-pane {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
}

.damage-skill-move-group {
  display: grid;
  gap: 6px;
}

.damage-skill-move-group h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.damage-skill-move-group h3 span {
  color: var(--blue);
  font-size: 12px;
}

.damage-skill-move-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.damage-skill-move-option:hover,
.damage-skill-move-option.active {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.damage-skill-move-option strong,
.damage-skill-move-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.damage-skill-move-option strong {
  font-size: 13px;
  line-height: 1.3;
}

.damage-skill-move-option span {
  justify-self: end;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.damage-skill-row-head {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.damage-skill-row-head strong,
.damage-skill-row-head span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.damage-skill-row-head strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.damage-skill-row-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.damage-skill-choice-list {
  display: grid;
  gap: 8px;
}

.damage-skill-choice-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(140px, 1fr) minmax(84px, auto) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.damage-skill-choice-row.active {
  border-color: var(--blue);
  background: #f8fbff;
  box-shadow: 0 10px 24px rgba(47, 125, 246, 0.12);
}

.damage-skill-choice-row strong,
.damage-skill-choice-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.damage-skill-choice-row strong {
  font-size: 13px;
  line-height: 1.35;
}

.damage-skill-choice-row span {
  color: var(--muted);
  font-size: 12px;
}

.damage-skill-choice-row b {
  justify-self: end;
  color: var(--blue);
  font-size: 14px;
}

.damage-skill-select-btn {
  justify-self: end;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.damage-skill-select-btn:hover {
  border-color: var(--blue);
  background: #e0f0ff;
}

.custom-buff-stat-rows {
  display: grid;
  gap: 8px;
}

.custom-buff-stat-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 180px);
  gap: 12px;
  align-items: end;
}

.custom-skill-target {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.custom-skill-target-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 8px;
  align-items: end;
}

.raw {
  max-height: 360px;
  min-height: 180px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f141c;
  color: #d9e7ff;
  font-family: "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.modal-raw-details,
.maintenance-preview-card {
  margin-top: 18px;
}

.modal-raw-details summary,
.maintenance-preview-card summary {
  cursor: pointer;
  font-weight: 900;
}

.modal-raw-details .raw,
.maintenance-preview-card .raw {
  margin-top: 12px;
}

.hero-mini-mark {
  width: 58px;
  height: 58px;
}

.inventory-layout {
  display: grid;
  grid-template-columns: minmax(640px, 1fr) minmax(360px, 420px);
  gap: 16px;
  align-items: start;
}

.inventory-main,
.inventory-side {
  min-width: 0;
}

.inventory-side {
  position: sticky;
  top: 18px;
}

.import-grid,
.inventory-toolbar,
.editor-grid {
  display: grid;
  gap: 12px;
}

.import-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
}

.inventory-toolbar {
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(120px, 0.75fr));
  align-items: end;
  margin-bottom: 14px;
}

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

.import-text-field {
  margin-top: 12px;
}

.import-text-field textarea {
  min-height: 160px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.disc-table-wrap {
  max-height: 660px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.disc-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.disc-table th,
.disc-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.disc-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f7fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.disc-table tbody tr {
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.disc-table tbody tr:hover {
  background: #f8fbff;
}

.disc-table tbody tr.selected {
  background:
    linear-gradient(90deg, rgba(246, 201, 69, 0.22), transparent 70%),
    #ffffff;
}

.disc-table tbody tr.selected td:first-child {
  box-shadow: inset 4px 0 0 var(--yellow);
}

.substat-cell {
  max-width: 360px;
  color: var(--muted);
  line-height: 1.45;
}

.table-empty {
  height: 86px;
  color: var(--muted);
  text-align: center;
  vertical-align: middle;
}

.detail-card {
  overflow: hidden;
}

.disc-editor {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.disc-editor .field input[readonly] {
  color: var(--muted);
  background: #f3f6fa;
}

.checkbox-row {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.editor-block {
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.stat-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(90px, 0.65fr);
  gap: 10px;
}

.substat-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.disc-picker {
  display: none;
}

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

.disc-card {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  min-height: 92px;
  padding: 10px;
  width: 100%;
  border: 1px dashed #b8d7ff;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.disc-card:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 20px rgba(47, 125, 246, 0.12);
}

.disc-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.disc-art img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.disc-art span {
  position: absolute;
  inset: auto 6px 6px auto;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  line-height: 1;
}

.disc-copy {
  min-width: 0;
}

.disc-copy .disc-set {
  min-height: 0;
  margin-top: 3px;
}

.disc-copy .disc-main,
.disc-copy .disc-sub {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.inventory-content {
  padding-bottom: 28px;
}

.inventory-shell {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.inventory-topline,
.inventory-footline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.inventory-topline h2 {
  margin: 0;
  font-size: 17px;
}

.inventory-topline p,
.inventory-footline {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.inventory-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.analysis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.drive-disc-analysis-modal {
  width: min(980px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 48px));
}

.analysis-status {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.drive-disc-analysis-content {
  display: grid;
  gap: 16px;
  overflow: auto;
  padding-right: 4px;
}

.analysis-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.analysis-summary-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel-2);
}

.analysis-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.analysis-summary-grid strong {
  font-size: 18px;
}

.analysis-distribution,
.analysis-one-roll {
  display: grid;
  gap: 8px;
}

.analysis-mode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.analysis-mode-toggle {
  grid-template-columns: repeat(2, minmax(86px, 1fr));
}

.analysis-one-roll h3 {
  margin: 0;
  font-size: 15px;
}

.analysis-bar-row {
  display: grid;
  grid-template-columns: 112px minmax(120px, 1fr) 72px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.analysis-bar-row > strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.analysis-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}

.analysis-bar-fill {
  height: 100%;
  border-radius: inherit;
}

.analysis-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.analysis-table th,
.analysis-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
}

.analysis-table th {
  color: var(--muted);
  font-weight: 600;
}

.analysis-empty {
  padding: 28px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
}

.analysis-line-chart-wrap {
  width: 100%;
  overflow-x: auto;
}

.analysis-line-chart {
  display: block;
  width: 100%;
  min-width: 640px;
  height: 320px;
}

.analysis-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.analysis-axis-line {
  stroke: var(--muted);
  stroke-width: 1;
}

.analysis-axis-label {
  fill: var(--muted);
  font-size: 12px;
}

.analysis-axis-label-x {
  text-anchor: middle;
}

.analysis-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--muted);
}

.analysis-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.analysis-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  color: var(--muted);
  font-size: 13px;
}

.inline-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.danger-text {
  color: #d94848;
}

.muted-text {
  color: var(--muted);
}

.loadout-row-incomplete {
  background: rgba(217, 72, 72, 0.04);
}

.inventory-view-tabs {
  position: sticky;
  top: 10px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(16, 19, 24, 0.08);
  backdrop-filter: blur(8px);
}

.inventory-view-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.inventory-view-tabs button:hover,
.inventory-view-tabs button.active {
  border-color: #f4d567;
  background: #fff8d8;
  color: var(--ink);
}

.inventory-view-tabs strong {
  display: inline-grid;
  min-width: 28px;
  height: 24px;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(74, 144, 226, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.import-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.inventory-filter-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(160px, 0.7fr) minmax(220px, 1fr) minmax(140px, 0.6fr);
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.slot-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(42px, 1fr));
  gap: 0;
  margin-top: 14px;
  border-bottom: 1px solid var(--line);
}

.slot-tabs button {
  min-height: 44px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--soft);
  font-weight: 900;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.slot-tabs button:hover,
.slot-tabs button.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.clean-table-wrap {
  margin-top: 10px;
  max-height: calc(100vh - 360px);
  min-height: 260px;
  border: 0;
}

.clean-disc-table {
  min-width: 880px;
}

.disc-row-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.disc-row-identity img {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.disc-row-identity strong,
.disc-row-identity span {
  display: block;
}

.disc-row-identity span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.loadout-slots-cell {
  min-width: 360px;
}

.loadout-slot-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.loadout-slot-chip {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  width: 112px;
  min-height: 42px;
  padding: 5px 7px;
  border: 1px solid #d7e4f5;
  border-radius: 8px;
  background: #f8fbff;
  box-shadow: inset 3px 0 0 var(--yellow);
}

.loadout-slot-chip.missing {
  border-color: rgba(217, 72, 72, 0.26);
  background: #fff7f7;
  box-shadow: inset 3px 0 0 #d94848;
}

.loadout-slot-chip img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.loadout-slot-chip span,
.loadout-slot-chip strong,
.loadout-slot-chip em {
  display: block;
  min-width: 0;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loadout-slot-chip strong {
  color: var(--blue);
  font-size: 11px;
  font-style: normal;
}

.loadout-slot-chip em {
  margin-top: 2px;
  color: var(--soft);
  font-size: 11px;
  font-style: normal;
}

.rarity-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid #f3d46f;
  border-radius: 999px;
  background: #fff8d8;
  color: #7c5b00;
  font-weight: 900;
}

.inventory-empty {
  display: grid;
  place-items: center;
  min-height: 380px;
  color: var(--muted);
  text-align: center;
}

.inventory-empty img {
  width: 142px;
  height: 142px;
  opacity: 0.78;
}

.inventory-empty strong {
  margin-top: 8px;
  color: var(--soft);
  font-size: 15px;
}

.inventory-empty span {
  margin-top: 6px;
  font-size: 13px;
}

body.modal-open {
  overflow: hidden;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.modal-layer .modal-scrim {
  animation: modal-scrim-fade 0.18s ease;
}

.modal-layer .disc-modal {
  animation: modal-enter 0.2s ease;
}

@keyframes modal-scrim-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(16, 20, 27, 0.56);
}

.disc-modal {
  position: relative;
  width: min(1460px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  margin: 18px auto;
  padding: 22px 20px 18px;
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(16, 19, 24, 0.28);
}

.modal-close {
  position: absolute;
  z-index: 5;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #d7dde7;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.modal-head {
  position: sticky;
  top: -22px;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 42px;
  margin: -22px -20px 0;
  padding: 22px 48px 14px 20px;
  border-bottom: 3px solid var(--yellow);
  background:
    linear-gradient(135deg, rgba(246, 201, 69, 0.16), transparent 44%),
    linear-gradient(90deg, #111722, #1c2634);
  color: #fff;
}

.modal-head h2 {
  margin: 0;
  font-size: var(--text-2xl);
  color: #fff;
}

.modal-head p {
  margin: 8px 0 0;
  color: #cbd5e1;
  font-size: 13px;
}

.modal-editor {
  margin-top: 22px;
}

.app-dialog-layer {
  z-index: 40;
}

.app-dialog {
  width: min(520px, calc(100vw - 32px));
  margin-top: min(120px, 18vh);
  padding-bottom: 18px;
}

.app-dialog .modal-head {
  position: static;
  margin: -22px -20px 0;
}

.app-dialog-field {
  margin-top: 18px;
}

.app-dialog-actions {
  margin-top: 18px;
}

.app-dialog-danger .modal-head h2 {
  color: #fca5a5;
}

.modal-section {
  min-width: 0;
  margin-top: 18px;
}

.modal-section h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.set-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 12px;
}

.set-option,
.partition-option {
  display: grid;
  place-items: center;
  gap: 7px;
  min-height: 92px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.set-option:hover,
.set-option.active,
.partition-option:hover,
.partition-option.active {
  border-color: #f4d567;
  background: #fffdf2;
  color: var(--ink);
  box-shadow: 0 12px 24px rgba(16, 19, 24, 0.1);
}

.set-option img,
.partition-option img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.set-option span,
.partition-option span {
  max-width: 100%;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
}

.partition-palette {
  display: grid;
  grid-template-columns: repeat(6, minmax(76px, 1fr));
  gap: 10px;
  max-width: 640px;
}

.modal-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.rarity-buttons {
  display: flex;
  gap: 8px;
}

.rarity-buttons button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #e4a400;
  font-weight: 900;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.rarity-buttons button.active {
  border-color: #f3d46f;
  background: #fff8d8;
}

.level-control {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px;
  gap: 18px;
  align-items: center;
}

.level-control input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.stepper {
  display: grid;
  grid-template-columns: 36px minmax(56px, 1fr) 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.stepper button,
.stepper input {
  min-height: 34px;
  border: 0;
  text-align: center;
}

.stepper button {
  display: grid;
  place-items: center;
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 900;
}

.modal-raw {
  display: none;
}

.home-disc-modal {
  width: min(980px, calc(100vw - 32px));
}

.home-disc-filter-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(150px, 0.7fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: end;
  margin-top: 22px;
}

.home-disc-option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(560px, calc(100vh - 270px));
  margin-top: 14px;
  overflow: auto;
}

.home-disc-option {
  display: grid;
  grid-template-columns: 54px minmax(160px, 0.78fr) minmax(220px, 1.22fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.home-disc-option:hover,
.home-disc-option.active {
  border-color: var(--blue);
  background: #f8fbff;
}

.home-disc-option.active {
  box-shadow: inset 4px 0 0 var(--yellow);
}

.home-disc-option img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.home-disc-option-main,
.home-disc-option-stat {
  min-width: 0;
}

.home-disc-option-main strong,
.home-disc-option-main span,
.home-disc-option-stat strong,
.home-disc-option-stat span {
  display: block;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.home-disc-option-main span,
.home-disc-option-stat span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.home-disc-empty {
  min-height: 300px;
}

.maintenance-content {
  min-width: 0;
  padding-bottom: 32px;
  overflow-x: clip;
}

.maintenance-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  border-bottom: 1px solid var(--line);
}

.maintenance-tabs button {
  min-height: 40px;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.maintenance-tabs button:hover,
.maintenance-tabs button.active {
  border-color: var(--blue);
  color: var(--blue);
}

.maintenance-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
  margin-top: 16px;
}

.maintenance-list-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.maintenance-record-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-height: calc(100vh - 210px);
  overflow: auto;
}

.maintenance-record {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 58px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.maintenance-record:hover,
.maintenance-record.active {
  border-color: var(--blue);
  background: #f8fbff;
}

.maintenance-record.active {
  box-shadow: inset 4px 0 0 var(--yellow);
}

.maintenance-record:has(.maintenance-record-avatar) {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
}

.maintenance-record-avatar,
.teammate-maintenance-avatar {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.maintenance-record-avatar.empty,
.teammate-maintenance-avatar.empty {
  box-shadow: inset 0 0 0 2px #d7dee9;
}

.maintenance-record-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.maintenance-record strong,
.maintenance-record span {
  display: block;
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.maintenance-record span {
  color: var(--muted);
  font-size: 12px;
}

.teammate-maintenance-image {
  display: flex;
  align-items: end;
  min-width: 0;
}

.teammate-maintenance-image .teammate-maintenance-avatar {
  width: 64px;
  height: 64px;
  border-radius: 10px;
}

.teammate-buff-choice-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.teammate-buff-choice {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.teammate-buff-choice:hover,
.teammate-buff-choice.active {
  border-color: var(--blue);
  background: #f8fbff;
}

.teammate-buff-choice.active {
  box-shadow: inset 4px 0 0 var(--yellow);
}

.teammate-buff-choice strong,
.teammate-buff-choice span {
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.teammate-buff-choice span {
  color: var(--muted);
  font-size: 12px;
}

.maintenance-editor-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.maintenance-card,
.maintenance-preview-card {
  min-width: 0;
  max-width: 100%;
  box-shadow: var(--shadow);
}

.maintenance-form {
  display: grid;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
}

.maintenance-feedback {
  min-width: 0;
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.maintenance-feedback[data-tone="success"] {
  border-color: rgba(42, 157, 143, 0.35);
  background: #f1fbf8;
}

.maintenance-feedback[data-tone="error"] {
  border-color: rgba(214, 64, 69, 0.35);
  background: #fff5f5;
}

.maintenance-feedback strong {
  display: block;
  margin-bottom: 4px;
}

.maintenance-feedback ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.maintenance-save-strip {
  position: sticky;
  top: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 11px 12px;
  border: 1px solid #cfe1ff;
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.96);
  box-shadow: 0 10px 24px rgba(16, 19, 24, 0.08);
  backdrop-filter: blur(8px);
}

.maintenance-save-strip[data-tone="success"] {
  border-color: rgba(21, 128, 61, 0.32);
  background: rgba(240, 253, 244, 0.96);
}

.maintenance-save-strip[data-tone="error"] {
  border-color: rgba(180, 35, 24, 0.32);
  background: rgba(255, 245, 245, 0.96);
}

.maintenance-save-strip strong,
.maintenance-save-strip span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.maintenance-save-strip span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.required-mark {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(214, 64, 69, 0.1);
  color: #b4232a;
  font-size: 11px;
  font-weight: 900;
}

.maintenance-section {
  min-width: 0;
  max-width: 100%;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.maintenance-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.maintenance-section h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.maintenance-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 10px;
}

.maintenance-section-head h3 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.maintenance-section-head h4 {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.maintenance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.maintenance-grid.nested-grid {
  display: contents;
}

.stat-number-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.maintenance-form textarea {
  min-height: 92px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

.cinema-buff-rows {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.cinema-buff-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cinema-description-field {
  grid-column: 1 / -1;
}

.maintenance-form .field,
.maintenance-form label,
.maintenance-form input,
.maintenance-form select,
.maintenance-form textarea,
.maintenance-section-head .compact-btn {
  min-width: 0;
  max-width: 100%;
}

.maintenance-form #coreSkillJson {
  min-height: 180px;
  font-family: "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.skill-category-list,
.skill-move-list {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.skill-category-card,
.skill-move-card {
  min-width: 0;
  max-width: 100%;
}

.skill-category-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.skill-category-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  cursor: pointer;
}

.skill-category-card summary span {
  min-width: 0;
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.skill-category-card summary small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.skill-category-card > .maintenance-section-head,
.skill-category-card > .maintenance-grid,
.skill-category-card > .skill-move-list {
  margin: 12px;
}

.skill-category-toolbar {
  align-items: center;
}

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

.skill-category-grid {
  grid-template-columns: minmax(120px, 0.8fr) minmax(160px, 1fr) minmax(220px, 1.4fr) repeat(3, minmax(90px, 0.6fr));
}

.skill-move-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.skill-move-grid {
  grid-template-columns: minmax(130px, 0.9fr) minmax(180px, 1.4fr) minmax(150px, 0.9fr);
}

.skill-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.skill-multiplier-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.skill-multiplier-table th,
.skill-multiplier-table td {
  min-width: 86px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.skill-multiplier-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3f8;
  color: var(--muted);
  font-weight: 900;
}

.skill-multiplier-table th:first-child,
.skill-multiplier-table td:first-child {
  min-width: 130px;
}

.skill-multiplier-table th:nth-child(2),
.skill-multiplier-table td:nth-child(2) {
  min-width: 170px;
}

.skill-multiplier-table th:last-child,
.skill-multiplier-table td:last-child {
  min-width: 78px;
  border-right: 0;
}

.skill-multiplier-table tr:last-child td {
  border-bottom: 0;
}

.skill-multiplier-table input,
.skill-multiplier-table select {
  min-height: 32px;
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
}

.maintenance-stat-rows {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.maintenance-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 8px;
  align-items: end;
  min-width: 0;
  max-width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.maintenance-buff-effect-rows {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.maintenance-buff-effect-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 10px;
  align-items: end;
  min-width: 0;
  max-width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.maintenance-modification-values {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #d8e6f8;
  border-radius: 8px;
  background: #fff;
}

.maintenance-modification-values .modification-display-values-field {
  grid-column: span 2;
}

.maintenance-modification-preview {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.maintenance-preview-row {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.maintenance-preview-row strong,
.maintenance-preview-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.maintenance-preview-row strong {
  color: var(--ink);
  font-size: 13px;
}

.maintenance-preview-row span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.maintenance-skill-targets,
.maintenance-skill-target-row {
  display: grid;
  gap: 8px;
}

.maintenance-skill-target-row {
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  align-items: end;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.maintenance-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.maintenance-checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.maintenance-remove-stat {
  margin-bottom: 1px;
}

.maintenance-remove-stat,
.maintenance-remove-effect {
  width: 100%;
}

.form-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.maintenance-preview-card .raw {
  min-width: 0;
  max-width: 100%;
  max-height: 460px;
}

.disc-source-toggle {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(64px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.segmented-control button {
  min-height: 36px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button.active {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.loadout-apply-field {
  margin: 0;
}

.optimizer-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.25fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}

.optimizer-entity-card {
  gap: 14px;
}

.optimizer-entity-head {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.optimizer-entity-media {
  width: 74px;
  height: 74px;
  min-height: 74px;
  border-radius: 8px;
}

.optimizer-entity-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.optimizer-entity-fields,
.optimizer-placeholder-grid,
.optimizer-skill-grid {
  display: grid;
  gap: 10px;
  min-width: 0;
}

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

#agent-section .optimizer-placeholder-grid,
#agent-section .optimizer-skill-grid {
  margin-top: 10px;
}

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

.optimizer-skill-grid .field:last-child {
  grid-column: 1 / -1;
}

.optimizer-entity-meta {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.optimizer-weapon-effect {
  font-size: 12px;
}

.optimizer-weapon-effect .weapon-effect-body {
  max-height: 150px;
  overflow: auto;
  scrollbar-width: thin;
}

.optimizer-combat-section-grid .combat-group:first-child {
  padding-top: 0;
}

.optimizer-left,
.optimizer-center,
.optimizer-right {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.optimizer-settings-grid,
.optimizer-main-stat-grid,
.optimizer-min-grid,
.optimizer-target-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.optimizer-main-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.optimizer-set-choice-field {
  grid-column: 1 / -1;
}

.optimizer-subsection {
  margin-top: 20px;
}

.optimizer-subsection h3,
.optimizer-buff-groups h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
}

.optimizer-four-piece-buff-section {
  display: grid;
  gap: 10px;
}

.optimizer-four-piece-buff-mode {
  grid-template-columns: repeat(2, minmax(58px, 1fr));
}

.optimizer-four-piece-buff-summary {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.optimizer-four-piece-buff-summary span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.optimizer-four-piece-buff-list {
  display: grid;
  gap: 8px;
}

.optimizer-four-piece-buff-card {
  padding-right: 12px;
  background: #fff;
}

.optimizer-four-piece-buff-note {
  color: var(--muted);
  font-size: 12px;
}

.optimizer-main-stat-grid select[multiple] {
  min-height: 116px;
}

.field-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.field-row-head span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.two-piece-summary-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.two-piece-selected-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.two-piece-selected-empty {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}

.two-piece-selected-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  gap: 6px;
  padding: 3px 4px 3px 9px;
  border: 1px solid #cfe1ff;
  border-radius: 999px;
  background: #f2f7ff;
  color: #285da8;
  font-size: 12px;
  font-weight: 800;
}

.two-piece-selected-chip span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.set-selected-chip {
  padding-left: 5px;
}

.set-selected-chip img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--panel-2);
}

.two-piece-selected-chip button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #285da8;
}

.two-piece-selected-chip button .icon {
  width: 14px;
  height: 14px;
}

.two-piece-selected-chip button:hover {
  background: rgba(40, 93, 168, 0.12);
  color: var(--ink);
}

.disc-modal.two-piece-set-modal {
  width: min(920px, calc(100vw - 32px));
}

.two-piece-choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.two-piece-choice {
  display: grid;
  grid-template-columns: 18px 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.two-piece-choice:hover,
.two-piece-choice.active {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.two-piece-choice input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

.two-piece-choice img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--panel-2);
}

.two-piece-choice-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.two-piece-choice-text strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.two-piece-choice-text span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@media (max-width: 680px) {
  .two-piece-summary-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .two-piece-summary-actions .ghost-btn {
    width: 100%;
  }

  .two-piece-choice-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.main-stat-choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  min-width: 0;
}

.main-stat-choice {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.main-stat-choice:hover,
.main-stat-choice.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.main-stat-choice input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--blue);
}

.main-stat-choice span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.optimizer-main-stat-field,
.preferred-drive-disc-field {
  align-content: start;
}

.optimizer-run-summary {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.7fr) auto;
  gap: 12px;
  align-items: center;
  margin: 18px -2px -2px;
  padding: 12px;
  border: 1px solid #cfe1ff;
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.96);
  box-shadow: 0 -10px 24px rgba(16, 19, 24, 0.08);
  backdrop-filter: blur(8px);
}

.optimizer-run-summary[data-active="true"] {
  border-color: #9ec5ff;
}

.optimizer-run-summary span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.optimizer-run-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  max-height: 2.7em;
  overflow: hidden;
}

.optimizer-run-summary p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  max-height: 2.7em;
  overflow: hidden;
}

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

.optimizer-run-progress {
  margin: 0;
}

.optimizer-progress {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.optimizer-progress[hidden] {
  display: none;
}

.optimizer-progress-head,
.optimizer-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.optimizer-progress-head strong {
  color: var(--blue);
  font-size: 18px;
}

.optimizer-progress-head span,
.optimizer-progress-meta,
.optimizer-progress-note {
  color: var(--muted);
  font-size: 13px;
}

.optimizer-progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e8edf5;
}

.optimizer-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #57b8ff);
  transition: width 0.2s ease;
}

.optimizer-progress-note {
  overflow-wrap: anywhere;
}

.optimizer-workbench-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.optimizer-workbench-toolbar button {
  min-height: 34px;
}

.drive-disc-workbench-select {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.drive-disc-workbench-select .loadout-apply-field {
  max-width: 100%;
}

.optimizer-plan-section {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.optimizer-current-plan-section {
  margin-top: 14px;
}

.optimizer-plan-section .field-row-head {
  align-items: end;
}

.optimizer-plan-section .field-row-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.optimizer-result-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.optimizer-scheme-tabs {
  align-items: stretch;
  margin-bottom: 12px;
}

.optimizer-result-tab-items {
  display: contents;
}

.optimizer-result-tabs button {
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 110px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  padding: 5px 12px 6px;
  cursor: pointer;
  line-height: 1.15;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.optimizer-result-tabs button span {
  white-space: nowrap;
}

.optimizer-result-tabs button small {
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}

.optimizer-result-tabs button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.optimizer-result-list {
  display: grid;
  gap: 12px;
}

.optimizer-current-plan-list,
.optimizer-scheme-list {
  gap: 10px;
}

.optimizer-result-summary {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.optimizer-result-summary span {
  color: var(--muted);
  font-size: 13px;
}

.optimizer-result-hint {
  padding: 12px;
  border: 1px dashed #cfe1ff;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.optimizer-disc-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

button.optimizer-disc-row {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.optimizer-disc-row:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

button.optimizer-disc-row:disabled {
  cursor: default;
}

.optimizer-disc-row img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--panel-2);
}

.optimizer-disc-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.optimizer-disc-row span,
.optimizer-disc-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.optimizer-plan-empty {
  min-height: 180px;
  padding: 18px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.optimizer-plan-empty img {
  width: 96px;
  height: 96px;
}

.optimizer-save-actions {
  margin-top: 14px;
}

.optimizer-current-buff-details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.optimizer-current-buff-details > summary {
  cursor: pointer;
  list-style: none;
}

.optimizer-current-buff-details > summary::-webkit-details-marker {
  display: none;
}

.loadout-shell {
  margin-top: 18px;
}

.loadout-modal {
  width: min(1180px, calc(100vw - 32px));
}

.loadout-editor {
  display: grid;
  gap: 18px;
}

.loadout-editor-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  gap: 12px;
  align-items: end;
}

.loadout-slot-editors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.loadout-slot-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid #bfd3ef;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 248, 216, 0.86), #fff 30%);
  box-shadow: inset 4px 0 0 var(--yellow);
}

.loadout-slot-card.empty {
  border-style: dashed;
  background: #fbfcfe;
  box-shadow: inset 4px 0 0 #d7dee9;
}

.loadout-slot-card.missing {
  border-color: rgba(217, 72, 72, 0.34);
  background: linear-gradient(90deg, rgba(255, 247, 247, 0.95), #fff 32%);
  box-shadow: inset 4px 0 0 #d94848;
}

.loadout-slot-card-visual {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  min-height: 124px;
}

.loadout-slot-card-visual img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.loadout-slot-card-copy {
  min-width: 0;
}

.loadout-slot-card-copy strong,
.loadout-slot-card-copy span,
.loadout-slot-card-copy p {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.loadout-slot-kicker {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.loadout-slot-card-copy strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
}

.loadout-slot-main {
  margin-top: 7px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
}

.loadout-slot-card-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.loadout-slot-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.loadout-slot-card-meta > span:not(.rarity-pill) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.maintenance-inline-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.maintenance-inline-checkbox input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
}

.loadout-slot-select-field {
  margin-top: 10px;
}

.loadout-slot-select-field select {
  min-height: 36px;
}

@media (min-width: 1241px) {
  .optimize-content {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 18px;
  }

  .optimize-content .page-header {
    flex: 0 0 auto;
  }

  .optimizer-workspace {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
  }

  .optimizer-left,
  .optimizer-center,
  .optimizer-right {
    align-content: start;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
  }
}

@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 4px solid var(--yellow);
  }

  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-item {
    min-height: 34px;
  }

  .sidebar-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 0;
  }

  .mini-note {
    margin-top: 0;
  }

  .workspace,
  .optimizer-workspace {
    grid-template-columns: 1fr;
  }

  .optimize-content {
    height: auto;
    overflow: visible;
  }

  .optimizer-workspace {
    overflow: visible;
  }

  .optimizer-left,
  .optimizer-center,
  .optimizer-right {
    height: auto;
    overflow: visible;
    padding-right: 0;
  }

  .inventory-layout {
    grid-template-columns: 1fr;
  }

  .inventory-side {
    position: static;
  }

  .maintenance-layout {
    grid-template-columns: 1fr;
  }

  .maintenance-list-panel {
    position: static;
  }

  .maintenance-record-list {
    max-height: 320px;
  }
}

@media (max-width: 820px) {
  .content {
    padding: 16px 12px 32px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .page-notice {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .page-notice-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .header-actions {
    justify-content: flex-start;
  }

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

  .hero-stats {
    grid-template-columns: 1fr;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .hero-stat {
    min-height: 70px;
    border-left: 0;
    border-top: 1px solid rgba(215, 222, 232, 0.85);
  }

  .hero-stat:first-child {
    border-top: 0;
  }

  .form-grid.two-up,
  .stat-strip,
  .disc-picker,
  .disc-grid,
  .panel-band,
  .panel-summary,
  .kv-table,
  .split-list,
  .import-grid,
  .inventory-toolbar,
  .inventory-filter-row,
  .home-disc-filter-row,
  .modal-form-grid,
  .editor-grid,
  .teammate-disc-selects,
  .combat-manual-grid,
  .maintenance-grid,
  .skill-category-grid,
  .skill-move-grid,
  .stat-number-grid,
  .maintenance-stat-row,
  .maintenance-buff-effect-row,
  .combat-runtime-grid,
  .combat-buff-teammate-picker,
  .target-settings-grid,
  .disc-source-toggle,
  .loadout-editor-fields,
  .optimizer-settings-grid,
  .optimizer-main-stat-grid,
  .optimizer-min-grid,
  .optimizer-target-grid,
  .calculation-objective-grid,
  .calculation-config-workspace,
  .calculation-event-list-item,
  .loadout-slot-editors,
  .damage-whitebox-row {
    grid-template-columns: 1fr;
  }

  .calculation-config-workspace {
    min-height: 0;
  }

  .calculation-config-event-list,
  .calculation-event-grid {
    max-height: none;
  }

  .calculation-config-footer {
    align-items: stretch;
  }

  .damage-whitebox-panel > div {
    grid-template-columns: 1fr;
  }

  .damage-skill-choice-row {
    grid-template-columns: 1fr;
  }

  .damage-skill-choice-row b {
    justify-self: start;
  }

  .damage-skill-select-btn {
    justify-self: start;
  }

  .damage-skill-cascade {
    grid-template-columns: 1fr;
  }

  .damage-skill-move-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .skill-category-card summary,
  .skill-level-chip {
    grid-template-columns: 1fr;
  }

  .target-settings-grid .target-resistance-field {
    grid-column: auto;
  }

  .inventory-topline,
  .modal-head {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-actions,
  .modal-actions {
    justify-content: flex-start;
  }

  .inventory-view-tabs {
    top: 0;
  }

  .partition-palette {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }

  .level-control {
    grid-template-columns: 1fr;
  }

  .disc-table-wrap {
    max-height: none;
  }

  .entity-preview {
    grid-row: auto;
  }

  .score-card {
    min-height: 104px;
  }

  .tag {
    max-width: 64%;
  }

  .combat-buff-bulk-actions {
    justify-content: flex-start;
  }

  .optimizer-run-summary {
    position: sticky;
    bottom: 8px;
    grid-template-columns: 1fr;
  }

  .optimizer-run-actions {
    justify-content: stretch;
  }

  .optimizer-run-actions .primary-btn,
  .optimizer-run-actions .ghost-btn {
    flex: 1 1 160px;
  }

  .optimize-content > .page-header .header-actions {
    display: none;
  }
}

@media (max-width: 520px) {
  .sidebar {
    padding: 10px;
  }

  .brand {
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    font-size: 14px;
  }

  .brand-sub,
  .sidebar-foot {
    display: none;
  }

  .side-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    margin-top: 10px;
  }

  .nav-item {
    min-width: 0;
    min-height: 32px;
    justify-content: center;
    padding: 6px 4px;
    font-size: 12px;
    text-align: center;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .header-actions .primary-btn {
    grid-column: 1 / -1;
  }

  .title-block h1 {
    font-size: 24px;
  }

  .inventory-view-tabs {
    grid-template-columns: 1fr;
  }

  .inventory-view-tabs button {
    justify-content: space-between;
  }

  .loadout-slot-card-visual {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .loadout-slot-card-visual img {
    width: 54px;
    height: 54px;
  }

  .card {
    padding: 13px;
  }

  .card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .tag {
    max-width: 100%;
    text-align: left;
  }

  .primary-btn,
  .ghost-btn,
  .danger-btn {
    width: 100%;
    min-width: 0;
    padding-inline: 10px;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .slot-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .disc-modal {
    width: 100vw;
    max-height: 100vh;
    margin: 0;
    padding: 18px 12px;
    border-radius: 0;
  }

  .modal-close {
    top: 8px;
    right: 8px;
    background: var(--panel-2);
  }

  .modal-head {
    padding-right: 42px;
  }

  .combat-added-source-head {
    align-items: stretch;
    flex-direction: column;
  }

  .combat-remove-group-btn {
    width: 100%;
  }

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

  .home-disc-option {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .home-disc-option-stat {
    grid-column: 2;
  }

.home-disc-option img {
  width: 42px;
  height: 42px;
}

  .disc-card {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .disc-art {
    width: 54px;
    height: 54px;
  }

  .disc-art img {
    width: 46px;
    height: 46px;
  }
}

/* --- Import records modal --- */

.import-records-modal {
  width: min(900px, calc(100vw - 32px));
}

.import-records-modal .disc-table-wrap {
  max-height: 440px;
  margin-top: 18px;
}

.import-records-table {
  min-width: 720px;
}

/* --- Scanner modal --- */

.scan-modal {
  max-width: 520px;
  width: 90vw;
}

.scan-modal .modal-head {
  margin-bottom: 16px;
}

.scan-helper-guide {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0 8px;
}

.scan-guide-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.scan-guide-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.scan-guide-step p {
  margin: 0 0 4px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.scan-guide-step code {
  background: var(--hover);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.82rem;
}

.scan-guide-note {
  color: var(--muted);
  font-size: 0.82rem !important;
}

.scan-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.scan-download-btn {
  display: inline-flex;
  font-size: 0.85rem;
  text-decoration: none;
}

.scan-auto-retry {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 8px 0 0;
}

.scan-auto-retry-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  animation: scan-pulse 1.5s ease-in-out infinite;
}

@keyframes scan-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.scan-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scan-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.scan-option {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  white-space: nowrap;
}

.scan-max-input {
  width: 70px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.85rem;
  text-align: center;
}

.scan-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.scan-progress-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scan-progress-bar {
  height: 6px;
  background: var(--hover);
  border-radius: 3px;
  overflow: hidden;
}

.scan-progress-fill {
  height: 100%;
  width: 0;
  background: var(--blue);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.scan-progress-text {
  font-size: 0.82rem;
  color: var(--muted);
  min-height: 1.2em;
}

.scan-actions {
  display: flex;
  gap: 10px;
}
