/* ============================================================
   rocalc — modern restyle (Payon Stories)
   Structure, class names and IDs are unchanged from vanilla;
   only presentation. The engine's themes() still paints
   backgrounds inline via its color arrays (see theme-payon.js),
   so this sheet avoids fighting those inline styles.
   ============================================================ */

:root {
  --font-ui: "Inter", "Segoe UI", Tahoma, Arial, sans-serif;

  /* type scale (base 12px — the calc is dense by design) */
  --text-xs: 10px;
  --text-sm: 11px;
  --text-base: 12px;
  --text-md: 13px;
  --text-lg: 15.5px;

  /* spacing scale */
  --sp-1: 2px;
  --sp-2: 4px;
  --sp-3: 8px;
  --sp-4: 12px;
  --sp-5: 16px;
  --sp-6: 24px;

  /* fixed results sidebar (wide screens): edge offset + reserved width.
     --sidebar-reserve must be >= sidebar content width + both gaps. */
  --sidebar-left: 18px;
  --sidebar-top: 78px;
  --sidebar-reserve: 439px;

  --radius-panel: 14px;
  --radius-ctl: 8px;
  --border-light: #b9c2cc;
  --border-dark: #2b3542;
  --accent: #e8842c;
  --accent-soft: rgba(232, 132, 44, 0.35);
  --shadow-panel: 0 2px 10px rgba(0, 0, 0, 0.18);
  --shadow-pop: 0 6px 18px rgba(0, 0, 0, 0.35);
}

body {
  background-color: #cdf; /* repainted inline by themes() */
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.45;
  margin: 10px auto;
  display: table; /* load-bearing: shrink-wraps the calc */
  -webkit-font-smoothing: antialiased;
}

table {
  width: 100%;
  border-spacing: 0;
}
td {
  padding: 4px 4px 4px 4px;
  margin: 0;
  vertical-align: middle;
}

/* ---------- panel headers ---------- */
h1 {
  text-align: center;
}
h1,
h3 {
  margin: 0;
  border-radius: var(--radius-panel) var(--radius-panel) 0 0;
  border: none;
  background: linear-gradient(to bottom, #355, #477); /* repainted inline by themes() */
  background-color: #466;
  padding-left: 20px;
  height: 46px;
  font-family: var(--font-ui);
  font-size: var(--text-lg);
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: 2px;
  line-height: 46px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
h3 img {
  vertical-align: middle;
  margin-right: 6px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
}

/* ---------- controls ---------- */
input {
  margin: var(--sp-1);
  padding: 1px var(--sp-2);
  vertical-align: middle;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 1em;
  background: #fff;
  color: #16181c;
}
input[type="checkbox"] {
  accent-color: var(--accent);
  border: none;
  cursor: pointer;
}
input[type="button"],
input[type="submit"] {
  cursor: pointer;
  padding: 2px 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-ctl);
  background: #f2f4f7;
  font-weight: 600;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    transform 0.06s ease;
}
input[type="button"]:hover,
input[type="submit"]:hover {
  background: #fff;
  border-color: var(--accent);
}
input[type="button"]:active,
input[type="submit"]:active {
  transform: translateY(1px);
}
input::placeholder {
  font: 0.7rem/3 var(--font-ui);
  color: #999;
}
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}
select {
  border: 1px solid transparent;
  margin: 1px;
  background-color: #fc8; /* repainted inline by themes() */
  border-radius: var(--radius-ctl);
  font-family: var(--font-ui);
  font-size: 1.05em;
  padding: 1px var(--sp-1);
  color: #16181c;
  cursor: pointer;
  transition: border-color 0.12s ease;
}
select:hover {
  border-color: var(--accent-soft);
}
select option {
  padding: 0;
}

p {
  color: #d22;
  font-weight: 600;
}
b {
  font-weight: 700;
}
a {
  text-decoration: none;
}

/* ---------- link footer panel ---------- */
.links {
  background: linear-gradient(to bottom, #355, #477); /* repainted inline by themes() */
  background-color: #466;
  border-radius: var(--radius-panel);
  padding: 20px;
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow-panel);
}
.links a {
  color: #fff;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.4);
}
.links a:hover {
  color: #ffb454;
  border-bottom-color: #ffb454;
}
.main a {
  color: #c73e10;
}
.main a:hover {
  font-weight: 600;
  text-decoration: underline;
}

/* ---------- section subheaders ---------- */
.subheader input,
th input {
  border: 0;
  margin: 0 4px;
  padding: 0 2px;
  background-color: #fff;
  text-align: center;
  border-radius: 4px;
}
.subheader select,
th select {
  margin: 0;
  letter-spacing: 0;
  background-color: #fff;
}
.subheader div,
th div {
  font-weight: 400;
  letter-spacing: 0;
}
.subheader,
th {
  padding: var(--sp-2) var(--sp-3);
  color: #fff;
  font-size: var(--text-md);
  line-height: 1.7em;
  letter-spacing: 0.8px;
  font-weight: 600;
  background-color: #466; /* repainted inline by themes() */
  transition: background-color 0.25s ease;
}
th {
  text-align: left;
}

.thin select {
  height: 17px;
  margin: 1px;
}
.point {
  cursor: pointer;
}
.point:hover {
  text-decoration: underline;
}

/* ---------- panels ---------- */
.main {
  border: none;
  border-radius: 0 0 var(--radius-panel) var(--radius-panel);
  background-color: #fff; /* repainted inline by themes() */
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-panel);
  margin-bottom: var(--sp-5);
}
.tborder,
.tborderA {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 15px var(--sp-5) 0;
}
.tborderA {
  width: auto;
}
.tequip td {
  padding: 3px 4px 3px 1px;
  margin: 0;
  vertical-align: top;
}
/* Stats panel: no unique class on its <table class="tborder">, so scope by
   the status-points counter it contains. Matches the Equipment & Cards
   table's tighter vertical rhythm (3px) without touching HTML. */
table.tborder:has(#A_STPOINT) td:not(.subheader) {
  padding-top: 3px;
  padding-bottom: 3px;
}
.data {
  border-right: 1px dotted #999;
  padding-right: var(--sp-3);
}
.dotB {
  border-bottom: 1px dotted #999;
  padding-bottom: var(--sp-3);
}
.title {
  text-align: center;
  font-weight: 700;
  border-bottom: 2px solid currentColor;
  letter-spacing: 0.5px;
}
.center {
  text-align: center;
}
.right {
  float: right;
  font-weight: 300;
}
.left {
  float: left;
  font-weight: 300;
}
.manual input {
  border: 1px solid #777;
  width: 24px;
}
.mail {
  background: url(images/ce4.png) no-repeat;
  padding: 0 58px;
}

/* ---------- hover tooltips (skill/item alt names) ---------- */
.name {
  position: relative;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: help;
}
.name .nametext {
  visibility: hidden;
  opacity: 0;
  width: 200px;
  white-space: normal;
  background-color: #1d2531;
  color: #e7ecf2;
  text-align: center;
  border: 1px solid #39465a;
  border-radius: 8px;
  padding: 7px 6px;
  position: absolute;
  z-index: 4000;
  bottom: 160%;
  left: 50%;
  margin-left: -100px;
  font-weight: 400;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: opacity 0.12s ease;
}
.name .nametext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -8px;
  border-width: 8px;
  border-style: solid;
  border-color: #1d2531 transparent transparent transparent;
}
.name:hover .nametext {
  visibility: visible;
  opacity: 1;
}

/* ---------- fixed results sidebar (wide screens) ---------- */
@media screen and (min-width: 1277px) and (max-height: 1700px) {
  body {
    margin-left: var(--sidebar-reserve);
    margin-right: 18px;
  }
  #fixable {
    border: 0;
    position: fixed;
    top: var(--sidebar-top);
    left: var(--sidebar-left);
    /* results taller than the viewport scroll instead of clipping */
    max-height: calc(100vh - var(--sidebar-top) - 12px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #cresults {
    margin-top: 10px;
  }
}

/* ---------- small screens ---------- */
@media screen and (max-width: 760px) {
  body {
    margin: 4px;
  }
  h1,
  h3 {
    font-size: 1.1em;
    padding-left: 10px;
    letter-spacing: 1px;
  }
  .main {
    padding: 5px 8px 4px 8px;
  }
  .tborder,
  .tborderA {
    margin-right: 6px;
  }
}

#foot {
  line-height: 185%;
  text-align: right;
}

#calcoptions {
  background: linear-gradient(to bottom, #355, #477);
  border-bottom: 1px solid #999;
  border-right: 1px solid #999;
  position: fixed;
  top: 0;
  left: 0;
  padding: 5px;
  color: #fff;
}
#calcoptions p {
  color: #fc8;
  text-align: center;
}

/* ---------- save-slot popup ---------- */
.p_overlay {
  background: rgba(0, 0, 0, 0.75);
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 5000;
  display: block;
}
.p_box {
  background: #f2f2f2;
  border: none;
  z-index: 6000;
  display: block;
  width: 300px;
  position: relative;
  margin: 100px auto 0;
  height: 200px;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  padding: 14px;
}
.p_close {
  position: absolute;
  right: 10px;
  top: 5px;
  text-indent: -9999px;
  background: url(closebtnicon.png);
  width: 18px;
  height: 19px;
}

/* ============================================================
   Dark-theme support (body.t-dark set by theme-payon.js).
   Mostly fixes controls and the hardcoded inline colors that
   the engine JS emits (which CSS attribute selectors can
   override without touching the engine).
   ============================================================ */

body.t-dark {
  color-scheme: dark;
}
body.t-dark input {
  background: #232b36;
  color: #dbe2ea;
  border-color: var(--border-dark);
}
body.t-dark input[type="button"],
body.t-dark input[type="submit"] {
  background: #27303c;
  border-color: #3a4656;
}
body.t-dark input[type="button"]:hover,
body.t-dark input[type="submit"]:hover {
  background: #303a48;
  border-color: var(--accent);
}
/* The engine's themes() paints selects via a one-time inline style pass
   over whatever selects exist in the DOM at that moment (on load / theme
   switch). Anything injected later — a "click to show" panel expanded
   afterward, e.g. Additional Enchants — never gets repainted and falls
   back to the raw vanilla CSS (#fc8 orange). These CSS-level fallbacks
   apply immediately regardless of when the element appears; harmless
   redundancy where the inline paint already ran (same colors). */
body.t-dark select {
  color: #e2e8f0;
  background-color: #2a3340;
}
body.t-dark .subheader select,
body.t-dark th select {
  background-color: #232b36;
}
body.t-payon select {
  background-color: rgba(52, 64, 79, 0.6);
}
body.t-payon .subheader select,
body.t-payon th select {
  background-color: rgba(42, 52, 65, 0.55);
}
body.t-dark .subheader input,
body.t-dark th input {
  background-color: #232b36;
}
body.t-dark .tborder,
body.t-dark .tborderA {
  border-color: var(--border-dark);
}
body.t-dark .data {
  border-right-color: #3a4656;
}
body.t-dark .dotB {
  border-bottom-color: #3a4656;
}
body.t-dark .manual input {
  border-color: #4a5668;
}
body.t-dark p {
  color: #ff8177;
}
body.t-dark .main a {
  color: #ffb454;
}
body.t-dark .p_box {
  background: #1a212b;
  color: #dbe2ea;
}
body.t-dark ::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
body.t-dark ::-webkit-scrollbar-track {
  background: #12161c;
}
body.t-dark ::-webkit-scrollbar-thumb {
  background: #313c4b;
  border-radius: 6px;
  border: 2px solid #12161c;
}

/* Inline colors written by the engine JS, remapped for contrast on dark.
   (Engine files can't be edited; these attribute selectors override the
   inline style/font-color attributes they emit.) */
body.t-dark [style*="color:blue" i],
body.t-dark [style*="color: blue" i] {
  color: #6fa8ff !important;
}
body.t-dark [style*="color:green" i] {
  color: #4ade80 !important;
}
body.t-dark [style*="color:#00DD00" i],
body.t-dark [style*="color:#00CC00" i] {
  color: #4ade80 !important;
}
body.t-dark [style*="color:red" i],
body.t-dark [style*="color:#F00" i],
body.t-dark [style*="color:#FF0000" i] {
  color: #ff7a70 !important;
}
body.t-dark [style*="color:purple" i] {
  color: #c084fc !important;
}
body.t-dark [style*="color:brown" i] {
  color: #d3a06c !important;
}
body.t-dark [style*="color:orange" i] {
  color: #ffb454 !important;
}
body.t-dark [style*="color:black" i],
body.t-dark [style*="color:#000000" i] {
  color: #e6e1d8 !important;
}
body.t-dark [style*="color:#CDCD40" i],
body.t-dark [style*="color:#CDCD00" i] {
  color: #e5e56a !important;
}
body.t-dark [style*="color:#A89682" i] {
  color: #c9b8a3 !important;
}
body.t-dark [style*="color:#9F9E9B" i] {
  color: #b8b6b2 !important;
}
body.t-dark [style*="color:#BB24BB" i] {
  color: #e06ae0 !important;
}
body.t-dark font[color="red" i],
body.t-dark font[color="#FF0000" i] {
  color: #ff7a70;
}

/* ============================================================
   Searchable combobox layer (combobox.js).
   The real <select> keeps its name/ID and stays in the DOM,
   visually parked (not display:none) so the engine and no-JS
   fallback are unaffected. !important is needed to beat the
   inline width styles the engine writes on weapon/card selects.
   ============================================================ */

select.cbx-hosted {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.cbx {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
}
.cbx-trigger {
  font-family: var(--font-ui);
  font-size: 1.05em;
  border: 1px solid transparent;
  border-radius: var(--radius-ctl);
  background-color: #fc8;
  color: #16181c;
  cursor: pointer;
  padding: 1px 18px 1px 6px;
  margin: 1px;
  min-width: 110px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  transition: border-color 0.12s ease;
}
.cbx-trigger:hover {
  border-color: var(--accent-soft);
}
.cbx-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}
.cbx-caret {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.65;
  pointer-events: none;
}
.cbx-pop {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 4800;
  min-width: 230px;
  max-width: 330px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  padding: 6px;
}
.cbx-filter {
  width: calc(100% - 12px);
  box-sizing: border-box;
  margin: 0 0 6px 0 !important;
  display: block;
}
.cbx-list {
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cbx-item {
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cbx-item.cbx-active {
  background: var(--accent-soft);
}
.cbx-item.cbx-selected {
  font-weight: 700;
}
.cbx-group {
  padding: 4px 6px 2px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.6;
}
body.t-dark .cbx-trigger {
  background-color: #2a3340;
  color: #e2e8f0;
}
body.t-dark .cbx-pop {
  background: #1d2531;
  border-color: var(--border-dark);
  color: #dbe2ea;
}
body.t-dark .cbx-item.cbx-active {
  background: #8a4d15;
}

/* ============================================================
   Glass Dark (theme 7, body.t-payon set by theme-payon.js).
   Panel FILLS come inline from the theme arrays (rgba); this
   section adds the backdrop blur, hairline borders, depth and
   the gradient canvas the glass refracts. Must stay LAST so it
   wins over the t-dark rules (same specificity, both classes
   are on <body> for theme 7).
   ============================================================ */

body.t-payon {
  /* colorful backdrop for the glass to blur; inline bBGC sits underneath */
  background-image:
    radial-gradient(1100px 700px at 85% -10%, rgba(232, 132, 44, 0.26), transparent 60%),
    radial-gradient(900px 650px at -10% 25%, rgba(52, 168, 160, 0.27), transparent 55%),
    radial-gradient(700px 500px at 70% 55%, rgba(58, 110, 200, 0.16), transparent 60%),
    radial-gradient(1000px 800px at 45% 115%, rgba(122, 88, 200, 0.22), transparent 60%);
  background-attachment: fixed;
}

body.t-payon h1,
body.t-payon h3,
body.t-payon .links {
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
body.t-payon .links {
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
/* .main hosts #fixable (position:fixed, Combat Simulator sidebar). A
   backdrop-filter/transform/filter on an element makes IT the containing
   block for its position:fixed descendants (CSS spec), which would hijack
   #fixable's viewport-relative pinning and dump it in normal flow instead.
   So the blur lives on a ::before layer (not on .main itself) — a filter on
   a pseudo-element doesn't create a containing block for the real element's
   descendants. .main keeps only border/shadow/position; its inline
   background-color (painted by the engine's themes()) is neutralized so the
   ::before glass fill shows through instead. */
body.t-payon .main {
  position: relative;
  background-color: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: none;
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
body.t-payon .main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  /* keep in sync with mBGC[7] in theme-payon.js */
  background-color: rgba(17, 22, 29, 0.52);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}
/* sidebar tables sit directly on the canvas — they get their own glass */
body.t-payon #fixable .tborderA,
body.t-payon #fixable .tborder,
body.t-payon #cresults {
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
/* tables nested inside .main: hairline border, translucent fill, no double blur */
body.t-payon .tborder,
body.t-payon .tborderA {
  border-color: rgba(255, 255, 255, 0.09);
}
body.t-payon input {
  background: rgba(36, 45, 57, 0.55);
  border-color: rgba(255, 255, 255, 0.12);
}
body.t-payon input[type="button"],
body.t-payon input[type="submit"] {
  background: rgba(48, 60, 74, 0.55);
  border-color: rgba(255, 255, 255, 0.14);
}
body.t-payon input[type="button"]:hover,
body.t-payon input[type="submit"]:hover {
  background: rgba(64, 79, 96, 0.65);
  border-color: var(--accent);
}
body.t-payon .cbx-trigger {
  background-color: rgba(52, 64, 79, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}
body.t-payon .cbx-pop {
  background: rgba(22, 29, 38, 0.78);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border-color: rgba(255, 255, 255, 0.12);
}
body.t-payon .p_box {
  background: rgba(24, 31, 40, 0.8);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
body.t-payon .data {
  border-right-color: rgba(255, 255, 255, 0.14);
}
body.t-payon .dotB {
  border-bottom-color: rgba(255, 255, 255, 0.14);
}
body.t-payon .name .nametext {
  background-color: rgba(24, 31, 40, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, 0.14);
}
body.t-dark [style*="color:#DDF" i] {
  color: #b9c8ff !important;
}
body.t-dark [style*="background-color:#DDF" i] {
  background-color: #26324a !important;
  color: #dbe2ea !important;
}
body.t-dark .mail {
  background-color: #e8e8e8;
  border-radius: 6px;
  background-position: center;
}

/* ============================================================
   Stat number-input layer (stat-input.js): overlays STR/AGI/
   VIT/INT/DEX/LUK selects with an integer text input + +/-
   buttons. The real <select> stays in the DOM (name/id intact,
   visually parked) so the engine drives the same code path.
   ============================================================ */

select.stin-hosted {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.stin {
  display: inline-flex;
  align-items: stretch;
  vertical-align: middle;
  border: 1px solid transparent;
  border-radius: var(--radius-ctl);
  background-color: #fc8;
  margin: 1px;
  overflow: hidden;
  transition: border-color 0.12s ease;
}
.stin:hover {
  border-color: var(--accent-soft);
}
.stin:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}
.stin-field {
  width: 2.8em; /* fits 3-digit values like Base Level up to 175 */
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 1px 2px !important;
  background: transparent !important;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 1.05em;
  color: inherit;
  -moz-appearance: textfield;
}
.stin-field::-webkit-outer-spin-button,
.stin-field::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stin-field:focus {
  outline: none;
}
.stin-btn {
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  cursor: pointer;
  width: 1.4em;
  font-family: var(--font-ui);
  font-size: 1em;
  line-height: 1;
  padding: 0;
}
.stin-btn:hover {
  background: rgba(0, 0, 0, 0.16);
}
.stin-btn:active {
  background: rgba(0, 0, 0, 0.24);
}
body.t-dark .stin {
  background-color: #2a3340;
  color: #e2e8f0;
}
body.t-dark .stin-btn {
  background: rgba(255, 255, 255, 0.06);
}
body.t-dark .stin-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
body.t-dark .stin-btn:active {
  background: rgba(255, 255, 255, 0.18);
}
body.t-payon .stin {
  background-color: rgba(52, 64, 79, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   Project Baldur Adjustments (card-enchant-sync.js).
   Read-only summary panel floating in the wide unused margin to
   the right of the Equipment & Cards column — visually distinct
   from the real Additional Enchants panel (accent-tinted border,
   its own boxed background) so it's never mistaken for something
   you typed.
   ============================================================ */

.ces-summary {
  position: absolute;
  left: 630px;
  width: 300px;
  padding: var(--sp-3) var(--sp-4);
  border: 1px dotted #999;
  border-radius: var(--radius-panel);
  background: rgba(0, 0, 0, 0.15);
}
.ces-summary-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: var(--sp-2);
}
.ces-summary-table {
  width: 100%;
  border-spacing: 0 2px;
}
.ces-summary-table .ces-card {
  font-weight: 600;
  padding-right: var(--sp-3);
  white-space: nowrap;
}
.ces-summary-table .ces-vals {
  opacity: 0.9;
}
.ces-summary-table .ces-empty {
  opacity: 0.6;
  font-style: italic;
  font-weight: 400;
}
body.t-dark .ces-summary,
body.t-payon .ces-summary {
  border-color: #3a4656;
  background: rgba(0, 0, 0, 0.25);
}

/* ============================================================
   OPTIONS row (index.html) — spreads the theme/ASPD selects and
   restriction checkboxes horizontally instead of stacking them
   with <br> tags, wrapping on narrow viewports.
   ============================================================ */
.options-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-5);
}
.options-row > span {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  white-space: nowrap;
}
