.spell-inline {
  display: inline;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #e3cf9d;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  cursor: help;
  text-decoration: underline dotted #8b7750;
  text-underline-offset: 3px;
}
.spell-inline img {
  display: inline-block;
  width: 18px;
  height: 18px;
  object-fit: cover;
  margin: 0 4px 0 1px;
  border: 1px solid #86724b;
  border-radius: 2px;
  vertical-align: -3px;
  box-shadow: 0 1px 3px #000b;
}
.spell-inline:hover { color: #fff0c5; }
.spell-inline:focus-visible { outline: 2px solid #b5d6ff; outline-offset: 3px; }
/* The legacy :is(button, #dialog-close, ...) rule carries ID specificity.
   Reset only prose references, including hover/pressed button decoration. */
body.reforged button.spell-inline {
  --button-art: none !important;
  appearance: none !important;
  display: inline !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-image: none !important;
  border-radius: 2px !important;
  background: none !important;
  box-shadow: none !important;
  color: #e3cf9d !important;
  font: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  text-align: inherit !important;
  text-transform: none !important;
  text-shadow: none !important;
  text-decoration: underline dotted #8b7750 !important;
  text-underline-offset: 3px !important;
  white-space: normal !important;
  vertical-align: baseline !important;
  transform: none !important;
  cursor: help !important;
}
body.reforged button.spell-inline:hover,
body.reforged button.spell-inline:active { color: #fff0c5 !important; }
body.reforged button.spell-inline::before,
body.reforged button.spell-inline::after { content: none !important; display: none !important; }
body.reforged button.spell-inline:focus-visible { outline: 2px solid #b5d6ff !important; outline-offset: 3px !important; }
.spell-hover-card {
  position: fixed;
  z-index: 12020;
  box-sizing: border-box;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
  color: #eee;
  background: linear-gradient(135deg, #0e1428fa, #070b14fc);
  border: 2px solid #9b8a6b;
  border-radius: 5px;
  box-shadow: 0 0 0 1px #090c13, inset 0 0 0 1px #ddcf9b35, 0 12px 40px #000c;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
.spell-hover-card[hidden] { display: none !important; }
.spell-reference-heading { display: flex; gap: 10px; align-items: center; margin: 0 0 9px; }
.spell-reference-heading img { border: 1px solid #a28b59; border-radius: 2px; flex: none; }
.spell-reference-heading strong { color: #ffda66; font-size: 17px; font-weight: 600; }
.spell-reference-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.spell-reference-controls label { display: flex; align-items: center; gap: 5px; color: #b9c1cf; font-size: 12px; }
.spell-reference-controls select { width: auto; padding: 4px; background: #121b2b; color: #fff; border: 1px solid #625d54; border-radius: 3px; font: inherit; }
.spell-reference-label { color: #98a4b7; font-size: 11px; }
.spell-official-line { display: flex; justify-content: space-between; gap: 12px; color: #eee; }
.spell-official-description { color: #ffd36b; white-space: pre-line; margin: 10px 0 0; font: inherit; line-height: 1.45; }
.spell-learned { color: #c4cad3; font-size: 12px; margin: 7px 0; }
.spell-reference-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding-top: 8px; border-top: 1px solid #5c60703d; }
.spell-reference-footer a { color: #9fb8d6; font-size: 11px; }
.spell-reference-footer button { padding: 4px 8px; border: 1px solid #74716c; border-radius: 3px; background: #1b2230; color: #eee; font: inherit; font-size: 12px; cursor: pointer; }
@media (max-width: 600px) { .spell-hover-card { padding: 12px; font-size: 13px; } .spell-inline img { width: 17px; height: 17px; } }
@media print {
  .spell-hover-card { display: none !important; }
  .spell-inline, body.reforged button.spell-inline { color: inherit !important; text-decoration: none !important; }
}
