:root {
  --bg: #eef6fb;
  --surface: rgba(253, 251, 247, 0.95);
  --surface-strong: #fffdf8;
  --surface-alt: #e9f2f7;
  --ink: #183246;
  --muted: #5d7687;
  --line: rgba(56, 92, 116, 0.16);
  --accent: #4f8db4;
  --accent-strong: #2d6487;
  --accent-soft: rgba(79, 141, 180, 0.14);
  --danger: #9d2f26;
  --shadow: 0 18px 40px rgba(51, 88, 112, 0.14);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-display: "Georgia", "Times New Roman", serif;
  --font-body: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(167, 210, 234, 0.2), transparent 32%),
    radial-gradient(circle at top right, rgba(190, 223, 240, 0.18), transparent 36%),
    linear-gradient(180deg, #eef6fb 0%, #eef6fb 100%);
}

.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  display: block;
  margin-bottom: 24px;
}

.hero-copy,
.panel,
.mount-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-copy,
.panel {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--accent-strong);
  font-weight: 700;
}

.hero-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  margin-bottom: 8px;
}

.hero-heading {
  min-width: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 3vw, 4rem);
  line-height: 1.04;
  margin-bottom: 14px;
}

h2 {
  font-size: 1.4rem;
  margin-bottom: 14px;
}

.hero-text,
.muted,
.status-message {
  color: var(--muted);
}

.hero-text {
  max-width: 60ch;
  margin-bottom: 18px;
}

.hero-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.hero-toolbar .button-row {
  justify-content: flex-end;
}

.hero-toolbar .status-message {
  margin: 0;
  text-align: right;
}

.hero-callouts {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  gap: 14px;
  margin-bottom: 16px;
}

.hero-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.hero-label {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.path-card code {
  display: block;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.notice-card p {
  margin: 0;
}

.hero-disclaimer {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(157, 47, 38, 0.16);
  background: rgba(255, 248, 244, 0.88);
  color: var(--muted);
  text-align: center;
}

.button-row,
.pill-row,
.mount-actions,
.summary-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

.sidebar,
.content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.view-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.guide-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(241, 248, 253, 0.95)),
    var(--surface);
}

.pairing-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.pairing-field {
  min-width: 220px;
  margin-bottom: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field:last-child {
  margin-bottom: 0;
}

.field span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input[type="search"],
input[type="text"],
select {
  width: 100%;
  border: 1px solid rgba(79, 122, 150, 0.24);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.is-active {
  background: var(--accent);
  color: #f8fcff;
  border-color: transparent;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.primary {
  background: var(--accent);
  color: #f8fcff;
}

.secondary,
.ghost {
  background: rgba(249, 252, 255, 0.92);
  color: var(--ink);
  border: 1px solid var(--line);
}

.danger {
  background: rgba(157, 47, 38, 0.12);
  color: var(--danger);
  border: 1px solid rgba(157, 47, 38, 0.18);
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-button input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.summary-card {
  flex: 1 1 130px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.summary-card strong {
  display: block;
  font-size: 1.5rem;
  font-family: var(--font-display);
}

.summary-card span {
  color: var(--muted);
  font-size: 0.85rem;
}

.empty-state {
  padding: 36px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(79, 122, 150, 0.28);
  background: rgba(248, 252, 255, 0.72);
  text-align: center;
}

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

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

.pairing-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.mount-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
}

.mount-card.is-deleted {
  opacity: 0.68;
  background: rgba(236, 239, 242, 0.96);
  border-style: dashed;
}

.pairing-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.pairing-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.pairing-summary {
  margin: 12px 0 0;
}

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

.pairing-mount {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  min-width: 0;
}

.pairing-mount-name {
  margin: 8px 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.pairing-mount-pills {
  margin-top: 12px;
}

.pairing-name-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pairing-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.mount-card-top {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.mount-title {
  margin-top: 4px;
  font-size: 1.45rem;
}

.position-badge {
  margin: 0;
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field.compact {
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
}

.pill.rarity-common {
  background: rgba(108, 124, 135, 0.14);
  color: #5f6f7a;
}

.pill.rarity-uncommon {
  background: rgba(79, 141, 180, 0.18);
  color: #2f7097;
}

.pill.rarity-rare {
  background: rgba(132, 98, 186, 0.2);
  color: #6f4fa7;
}

.pill.rarity-legendary {
  background: rgba(210, 167, 60, 0.2);
  color: #9c6d00;
}

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

.bloodline-bonus-pill {
  margin-top: 14px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  font-weight: 700;
}

.bloodline-bonus-pill.rarity-common {
  background: rgba(108, 124, 135, 0.12);
  color: #5f6f7a;
}

.bloodline-bonus-pill.rarity-uncommon {
  background: rgba(79, 141, 180, 0.14);
  color: #2f7097;
}

.bloodline-bonus-pill.rarity-rare {
  background: rgba(132, 98, 186, 0.15);
  color: #6f4fa7;
}

.bloodline-bonus-pill.rarity-legendary {
  background: rgba(210, 167, 60, 0.16);
  color: #9c6d00;
}

.info-section {
  margin-top: 16px;
}

.info-section summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
  list-style: none;
}

.info-section summary::-webkit-details-marker {
  display: none;
}

.info-section summary::after {
  content: "+";
  float: right;
  color: var(--accent-strong);
}

.info-section[open] summary::after {
  content: "-";
}

.detail-grid,
.breeding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.detail-item,
.breeding-stat {
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  min-width: 0;
}

.detail-item span,
.breeding-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-item strong,
.breeding-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.breeding-placeholder {
  margin-top: 18px;
}

.additional-info {
  margin-top: 18px;
}

.mount-actions {
  align-content: start;
  justify-content: end;
}

.orbital-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.orbital-row.is-drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 141, 180, 0.18);
}

.orbital-row.is-dragging {
  opacity: 0.55;
}

.orbital-handle {
  align-self: center;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--muted);
  border-radius: 12px;
  padding: 10px 8px;
  cursor: grab;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.orbital-handle:active {
  cursor: grabbing;
}

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

.orbital-mainline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.orbital-heading {
  min-width: 0;
}

.orbital-title {
  margin-top: 4px;
  font-size: 1.08rem;
}

.orbital-pills {
  justify-content: flex-end;
}

code {
  font-family: "Consolas", "Courier New", monospace;
  background: rgba(24, 50, 70, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
}

.inspector-pre {
  margin: 0;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 640px;
  overflow: auto;
}

@media (max-width: 980px) {
  .layout,
  .mount-card,
  .orbital-row {
    grid-template-columns: 1fr;
  }

  .pairing-grid {
    grid-template-columns: 1fr;
  }

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

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

  .hero-toolbar {
    align-items: stretch;
  }

  .hero-toolbar .button-row,
  .hero-toolbar .status-message {
    justify-content: flex-start;
    text-align: left;
  }

  .orbital-mainline {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .orbital-pills {
    justify-content: flex-start;
  }

  .mount-actions,
  .content-header {
    justify-content: start;
  }

  .page-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 20px;
  }
}
