/* ==========================================================================
   Blue Archive — Furniture & Students
   ========================================================================== */

:root {
  --bg: #141a26;
  --bg-2: #181f2d;
  --panel: #1b2332;
  --panel-solid: #1b2332;
  --panel-soft: rgba(255, 255, 255, 0.045);
  --line: #303d56;
  --line-soft: #28344a;
  --text: #eef2fb;
  --text-soft: #c6d0e4;
  --muted: #96a3bd;
  --cyan: #4cc9f0;
  --cyan-soft: rgba(76, 201, 240, 0.14);
  --pink: #ff5c9d;
  --green: #48e5a6;
  --green-soft: rgba(72, 229, 166, 0.12);
  --red: #ff6b7d;
  --red-soft: rgba(255, 107, 125, 0.12);
  --gold: #ffcf5c;
  --radius: 16px;
  --shadow: none;
  --font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system,
    "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before,
body::after {
  display: none;
}

::selection {
  background: rgba(76, 201, 240, 0.3);
}

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

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px 16px 18px;
  background: linear-gradient(180deg, rgba(11, 16, 29, 0.92), rgba(8, 11, 20, 0.88));
  border-right: 1px solid var(--line-soft);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 4px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(76, 201, 240, 0.95), rgba(94, 120, 255, 0.9) 55%, rgba(255, 92, 157, 0.9));
  color: #06111c;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  box-shadow: 0 8px 24px rgba(76, 201, 240, 0.28);
  transform: rotate(-2deg);
}

.brand h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.brand span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.sidebar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-label span {
  color: var(--text-soft);
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
}

.accounts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account {
  --accent: var(--cyan);
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 15px;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.account:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line-soft);
}

.account.active {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent), rgba(255, 255, 255, 0.02) 70%);
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.account:active {
  transform: scale(0.985);
}

.account-avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.35), transparent 42%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 88%, #fff 4%), color-mix(in srgb, var(--accent) 52%, #101728));
  color: #07111d;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 22%, transparent);
}

.account-avatar.big {
  width: 62px;
  height: 62px;
  border-radius: 19px;
  font-size: 25px;
}

.account-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 650;
}

.account-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10.5px;
}

.account-dot {
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  opacity: 0.75;
}

.account.placeholder {
  opacity: 0.52;
}

.account.placeholder .account-avatar {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--muted);
  box-shadow: none;
}

.account.placeholder .account-dot {
  background: transparent;
  border: 1px solid var(--muted);
  box-shadow: none;
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-note {
  padding: 14px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.022);
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
}

.sidebar-note .note-title {
  margin-bottom: 5px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-note a {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
}

/* --------------------------------------------------------------------------
   Main / hero
   -------------------------------------------------------------------------- */

.main {
  min-width: 0;
  padding: 34px clamp(20px, 3.4vw, 46px) 40px;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px 24px;
  animation: rise 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 280px;
  flex: 1 1 360px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
}

.hero-meta .chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  font-size: 10.5px;
  white-space: nowrap;
}

.hero-meta .chip.warn {
  color: var(--gold);
  border-color: rgba(255, 207, 92, 0.36);
  background: rgba(255, 207, 92, 0.085);
}

.hero-meta .chip.action {
  cursor: pointer;
  font-family: inherit;
}

.hero-meta .chip.action:hover {
  background: rgba(255, 207, 92, 0.16);
  border-color: rgba(255, 207, 92, 0.55);
}

.hero-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px 14px;
  flex: 0 1 auto;
  max-width: 100%;
  padding-top: 2px;
}

.ring {
  --p: 0%;
  position: relative;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--cyan) var(--p), rgba(255, 255, 255, 0.055) 0);
  box-shadow: 0 0 34px rgba(76, 201, 240, 0.1);
}

.ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #0c111f;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ring > div {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.ring strong {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.ring span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: linear-gradient(135deg, rgba(76, 201, 240, 0.95), rgba(74, 122, 255, 0.95));
  border-color: transparent;
  color: #04111d;
  box-shadow: 0 8px 22px rgba(76, 201, 240, 0.22);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #62d6f7, #608bff);
}

.btn.icon-only {
  width: 38px;
  padding: 0;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 13px 15px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
}

.stat::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -22px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--stat-color, var(--cyan));
  opacity: 0.075;
  filter: blur(2px);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.stat-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 5px;
}

.stat-value strong {
  font-size: 24px;
  font-weight: 760;
  letter-spacing: -0.03em;
  line-height: 1;
}

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

.stat-hint {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

/* --------------------------------------------------------------------------
   Toolbar
   -------------------------------------------------------------------------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 24px 0 18px;
  animation: rise 460ms 60ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.search {
  position: relative;
  flex: 1 1 280px;
  max-width: 430px;
}

.search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
}

.search input {
  width: 100%;
  height: 40px;
  padding: 0 38px 0 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 15, 27, 0.7);
  outline: none;
  font-size: 12.5px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search input::placeholder {
  color: var(--muted);
}

.search input:focus {
  border-color: rgba(76, 201, 240, 0.55);
  box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.11);
}

.search kbd {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 10px;
  font-family: inherit;
}

.segmented {
  display: flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 15, 27, 0.7);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  white-space: nowrap;
}

.segmented button:hover {
  color: var(--text-soft);
}

.segmented button.active {
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.segmented button em {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-style: normal;
  font-size: 9.5px;
  line-height: 16px;
  text-align: center;
}

.segmented button.active em {
  background: rgba(76, 201, 240, 0.18);
  color: var(--cyan);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 15, 27, 0.7);
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

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

.switch.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.switch.is-disabled .track::after {
  background: #7c879b;
}

.switch .track {
  position: relative;
  width: 30px;
  height: 17px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 150ms ease;
}

.switch .track::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #b8c2d8;
  transition: transform 160ms ease, background 160ms ease;
}

.switch input:checked + .track {
  background: rgba(76, 201, 240, 0.4);
}

.switch input:checked + .track::after {
  transform: translateX(13px);
  background: var(--cyan);
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  height: 40px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 15, 27, 0.7);
  color: var(--text-soft);
  font-size: 11.5px;
  appearance: none;
  outline: none;
  cursor: pointer;
}

.select-wrap::after {
  content: "⌄";
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-56%);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

.scope-select select {
  min-width: 172px;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.content {
  animation: rise 500ms 100ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(335px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.fcard {
  --edge: rgba(159, 186, 255, 0.16);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(20, 28, 48, 0.92), rgba(11, 16, 29, 0.96));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.fcard::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--edge) 22%, var(--edge) 78%, transparent);
  opacity: 0.8;
}

.fcard:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--edge) 70%, transparent);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.32);
}

.fcard.full {
  --edge: var(--green);
  border-color: rgba(72, 229, 166, 0.18);
}

.fcard.partial {
  --edge: var(--cyan);
}

.fcard.none {
  --edge: var(--red);
  border-color: rgba(255, 107, 125, 0.16);
}

.fcard.neutral {
  --edge: rgba(159, 186, 255, 0.35);
}

.fcard.craft {
  --edge: var(--gold);
  border-color: rgba(255, 207, 92, 0.24);
}

.fcard.future {
  --edge: rgba(159, 186, 255, 0.35);
  opacity: 0.84;
}

.fcard.craft .fcard-top {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 207, 92, 0.13), transparent 68%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), transparent);
}

.fcard.craft .fcard-top img {
  opacity: 0.76;
}

.fcard.future .fcard-top img {
  opacity: 0.46;
  filter: grayscale(0.55) brightness(0.78) drop-shadow(0 14px 18px rgba(0, 0, 0, 0.3));
}

.fcard-top {
  position: relative;
  height: 182px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--edge) 16%, transparent), transparent 68%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), transparent);
  border-bottom: 1px solid var(--line-soft);
}

.fcard-top::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 52%;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  filter: blur(9px);
}

.fcard-top img {
  position: relative;
  z-index: 1;
  width: 84%;
  height: 88%;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.35));
  transition: transform 220ms ease;
}

.fcard:hover .fcard-top img {
  transform: translateY(-3px) scale(1.025);
}

.badges {
  position: absolute;
  inset: 11px 11px auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  z-index: 2;
}

.badge-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 72%;
}

.own-badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.07em;
  backdrop-filter: blur(8px);
}

.own-badge.craft {
  color: var(--gold);
  border: 1px solid rgba(255, 207, 92, 0.4);
  background: rgba(255, 207, 92, 0.13);
}

.own-badge.future {
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(8, 12, 22, 0.62);
}

.rarity {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #07111c;
  background: #c7d3ea;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.rarity.SSR {
  background: linear-gradient(135deg, #c084fc, #8b5cf6 55%, #6d28d9);
  color: #fbf7ff;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.38);
}

.rarity.SR {
  background: linear-gradient(135deg, #ffe08a, #ffb020);
  color: #1b1303;
  box-shadow: 0 2px 10px rgba(255, 176, 32, 0.28);
}

.rarity.R {
  background: linear-gradient(135deg, #7fdcff, #4c9ff0);
}

.rarity.N {
  background: #9aa7bd;
}

.cafe-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  border: 1px solid transparent;
  cursor: default;
  user-select: none;
}

.cafe-badge.placed {
  color: #5ee9a0;
  background: rgba(20, 56, 40, 0.88);
  border-color: rgba(46, 160, 102, 0.55);
}

.cafe-badge.unplaced {
  color: #ff8c9e;
  background: rgba(59, 28, 36, 0.88);
  border-color: rgba(180, 68, 92, 0.5);
}

.badge-right {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.qty {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border: 1px solid rgba(76, 201, 240, 0.32);
  border-radius: 6px;
  background: rgba(76, 201, 240, 0.12);
  color: var(--cyan);
  font-size: 9.5px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.fcard-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 13px 14px 12px;
}

.fcard h3 {
  margin: 0;
  padding-right: 4px;
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.fcard h3 a {
  color: inherit;
}

.fcard h3 a:hover {
  color: var(--cyan);
  text-decoration: none;
}

.chars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 11px;
}

.char {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px 6px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  transition: background 150ms ease, border-color 150ms ease;
}

.char:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.char.missing {
  background: rgba(255, 107, 125, 0.035);
}

.portrait {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 48px;
  overflow: hidden;
  border-radius: 8px;
  background: #0a0f1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  display: block;
}

.char.missing .portrait img {
  filter: grayscale(0.75) brightness(0.62);
}

.char.missing .portrait {
  border-color: rgba(255, 107, 125, 0.18);
}

.char-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.char-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 620;
  line-height: 1.25;
}

.stars {
  display: inline-block;
  margin-right: 4px;
  color: var(--gold);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.char-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.char-sub .bond {
  color: var(--gold);
  font-weight: 650;
}

.char-sub .bond.capped {
  padding: 0 5px;
  border: 1px solid rgba(255, 207, 92, 0.38);
  border-radius: 999px;
  background: rgba(255, 207, 92, 0.13);
  color: #ffe08a;
}

.char-sub .bond.capped em {
  margin-left: 4px;
  padding: 0 3px;
  border-radius: 4px;
  background: var(--gold);
  color: #1b1303;
  font-style: normal;
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  vertical-align: 1px;
}

.char.capped {
  border-color: rgba(255, 207, 92, 0.24);
  background: linear-gradient(90deg, rgba(255, 207, 92, 0.05), rgba(255, 255, 255, 0.025));
}

.char-sub .not-owned {
  color: rgba(255, 107, 125, 0.85);
}

.status {
  flex: 0 0 auto;
  margin-left: auto;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.char.owned .status {
  color: #06130d;
  background: linear-gradient(135deg, #6af0bd, #33c993);
  box-shadow: 0 0 14px rgba(72, 229, 166, 0.25);
}

.char.missing .status {
  color: #26080d;
  background: linear-gradient(135deg, #ff9aa7, #ff5d72);
  box-shadow: 0 0 14px rgba(255, 107, 125, 0.18);
}

.char.unknown .status {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}

.no-interaction {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 10.5px;
}

/* --------------------------------------------------------------------------
   Empty / placeholder
   -------------------------------------------------------------------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  padding: 42px 26px;
  border: 1px dashed rgba(159, 186, 255, 0.2);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(76, 201, 240, 0.06), transparent 55%);
  text-align: center;
}

.empty-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--cyan);
  font-size: 28px;
  box-shadow: 0 0 40px rgba(76, 201, 240, 0.08);
}

.empty h2 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.empty p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.empty code,
.empty pre {
  display: inline-block;
  margin-top: 14px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(5, 8, 15, 0.75);
  color: var(--text-soft);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  text-align: left;
  white-space: pre-wrap;
}

.empty .empty-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 34px;
  padding-top: 15px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 10px;
}

.footer .dot-sep {
  margin: 0 7px;
  opacity: 0.5;
}

/* --------------------------------------------------------------------------
   Compare modal
   -------------------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 10, 0.72);
  backdrop-filter: blur(8px);
  animation: fade 180ms ease both;
}

.modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1180px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid rgba(159, 186, 255, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, #101827, #0b101c);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
  animation: pop 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 15px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.modal-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 17px;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.modal-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 11px 22px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 10.5px;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend .mini-dot {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
}

.legend .mini-dot.yes {
  background: var(--green);
  color: #05130c;
}

.legend .mini-dot.no {
  background: var(--red);
  color: #22070b;
}

.legend .mini-dot.none {
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  border: 1px solid var(--line);
}

.modal-body {
  overflow: auto;
  padding: 0 0 18px;
}

.cmp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
}

.cmp-table th,
.cmp-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
  font-size: 11px;
}

.cmp-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #101827;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.cmp-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.024);
}

.cmp-furniture {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #0d1422;
  min-width: 245px;
  max-width: 320px;
}

.cmp-table tbody tr:hover .cmp-furniture {
  background: #121b2c;
}

.cmp-furniture-inner {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cmp-furniture img {
  width: 38px;
  height: 30px;
  object-fit: contain;
  flex: 0 0 auto;
}

.cmp-furniture b {
  display: block;
  font-size: 11.5px;
  font-weight: 620;
  color: var(--text);
}

.cmp-furniture small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.cmp-account-head {
  min-width: 130px;
  white-space: nowrap;
}

.cmp-account-head .acc-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 10.5px;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
}

.cmp-account-head .acc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.cmp-account-head .cmp-pieces {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.cmp-cell {
  min-width: 130px;
}

.cmp-cell.is-absent {
  color: rgba(127, 139, 168, 0.5);
  text-align: center;
  font-size: 13px;
}

.cmp-cell.is-full {
  background: rgba(72, 229, 166, 0.045);
}

.cmp-cell.is-none {
  background: rgba(255, 107, 125, 0.045);
}

.cmp-chars {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cmp-char {
  position: relative;
  width: 30px;
  height: 34px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0a0f1a;
}

.cmp-char img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 14%;
  display: block;
}

.cmp-char.yes {
  border-color: rgba(72, 229, 166, 0.75);
  box-shadow: 0 0 0 1px rgba(72, 229, 166, 0.25);
}

.cmp-char.no {
  border-color: rgba(255, 107, 125, 0.55);
}

.cmp-char.no img {
  filter: grayscale(0.75) brightness(0.58);
}

.cmp-char i {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 7px;
  font-weight: 900;
  border-radius: 4px 0 0;
}

.cmp-char.yes i {
  background: var(--green);
  color: #05130c;
}

.cmp-char.no i {
  background: var(--red);
  color: #22070b;
}

.cmp-count {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.cmp-count b {
  color: var(--text-soft);
}

.cmp-unknown {
  color: var(--muted);
  font-size: 15px;
}

.cmp-empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.modal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 22px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 10px;
}

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 200;
  transform: translate(-50%, 12px);
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #141c2d;
  color: var(--text-soft);
  font-size: 11px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

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

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   Flat theme + larger type
   -------------------------------------------------------------------------- */

body {
  background: #141a26;
  font-size: 15px;
}

.app {
  grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
  background: #181f2d;
  border-right: 1px solid #28344a;
  backdrop-filter: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--cyan);
  color: #0c1420;
  font-size: 16px;
  box-shadow: none;
  transform: none;
}

.brand h1 {
  font-size: 17px;
}

.brand span {
  font-size: 11.5px;
}

.sidebar-label {
  font-size: 11.5px;
}

.sidebar-label span {
  font-size: 10.5px;
}

.account {
  border-radius: 12px;
  padding: 11px 10px;
  transition: background 140ms ease, border-color 140ms ease;
}

.account:hover {
  background: #1f2839;
  border-color: #303d56;
}

.account.active {
  background: #1f2a3d;
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent);
  color: #0c1420;
  font-size: 16px;
  box-shadow: none;
}

.account-avatar.big {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  font-size: 24px;
}

.account-name {
  font-size: 14.5px;
}

.account-sub {
  font-size: 12.5px;
}

.account-dot {
  box-shadow: none;
}

.account.placeholder .account-avatar {
  background: #232c3e;
  border: 1px dashed #46536b;
  color: var(--muted);
}

.sidebar-note {
  background: #1b2332;
  border-color: #28344a;
  font-size: 12px;
}

.sidebar-note .note-title {
  font-size: 11px;
}

.sidebar-note a {
  font-size: 12px;
}

.eyebrow {
  font-size: 12px;
}

.hero h1 {
  font-size: clamp(32px, 3.2vw, 44px);
}

.hero-meta {
  font-size: 13px;
  gap: 7px 12px;
}

.hero-meta .chip {
  padding: 4px 10px;
  font-size: 12px;
}

.live-dot {
  box-shadow: none;
}

.ring {
  width: 90px;
  height: 90px;
  border-radius: 18px;
  background: #1b2332;
  border: 1px solid #303d56;
  box-shadow: none;
}

.ring::before {
  display: none;
}

.ring strong {
  font-size: 23px;
}

.ring span {
  font-size: 9.5px;
}

.btn {
  height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border-color: #33415c;
  background: #232d40;
  font-size: 13.5px;
}

.btn:hover {
  background: #2b374d;
  border-color: #41516e;
}

.btn.primary {
  background: var(--cyan);
  color: #07111c;
  box-shadow: none;
}

.btn.primary:hover {
  background: #6bd6f7;
}

.stats {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.stat {
  padding: 15px 16px 14px;
  border-radius: 12px;
  border-color: #2b374d;
  background: #1b2332;
}

.stat::after {
  display: none;
}

.stat-label {
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
}

.stat-value strong {
  font-size: 28px;
}

.stat-value span {
  font-size: 13px;
}

.stat-hint {
  font-size: 12.5px;
}

.search input {
  height: 44px;
  border-radius: 10px;
  border-color: #303d56;
  background: #151c29;
  font-size: 14px;
}

.search input:focus {
  box-shadow: none;
  border-color: var(--cyan);
}

.search kbd {
  font-size: 11px;
}

.segmented {
  border-radius: 10px;
  border-color: #303d56;
  background: #151c29;
}

.segmented button {
  height: 36px;
  border-radius: 8px;
  font-size: 13px;
}

.segmented button.active {
  background: #2a3548;
  box-shadow: none;
}

.segmented button em {
  font-size: 10.5px;
}

.switch {
  height: 44px;
  border-radius: 10px;
  border-color: #303d56;
  background: #151c29;
  font-size: 13px;
}

.select-wrap select {
  height: 44px;
  border-radius: 10px;
  border-color: #303d56;
  background: #151c29;
  font-size: 13px;
}

.scope-select select {
  min-width: 190px;
}

.cards {
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.fcard {
  border-radius: var(--radius);
  border-color: #2b374d;
  background: #1b2332;
  box-shadow: none;
  transition: border-color 140ms ease;
}

.fcard::before {
  display: none;
}

.fcard:hover {
  transform: none;
  box-shadow: none;
  border-color: #41516e;
}

.fcard.full {
  border-color: #2f6b58;
}

.fcard.partial {
  border-color: #355a6b;
}

.fcard.none {
  border-color: #6a3941;
}

.fcard.craft {
  border-color: #6b561f;
}

.fcard.future {
  border-color: #344055;
  opacity: 0.9;
}

.fcard-top {
  height: 190px;
  background: #161d29;
  border-bottom: 1px solid #28344a;
}

.fcard-top::after {
  display: none;
}

.fcard-top img {
  filter: none;
}

.fcard:hover .fcard-top img {
  transform: none;
}

.fcard.craft .fcard-top {
  background: #1e1c17;
}

.fcard.craft .fcard-top img {
  opacity: 0.78;
}

.fcard.future .fcard-top img {
  opacity: 0.48;
  filter: grayscale(0.55) brightness(0.78);
}

.fcard-body {
  padding: 15px 16px 16px;
}

.fcard h3 {
  font-size: 18px;
}

.badge-left {
  max-width: 78%;
}

.rarity {
  height: 23px;
  padding: 0 9px;
  font-size: 10.5px;
  box-shadow: none;
}

.rarity.SSR {
  background: #8b5cf6;
  color: #fff;
}

.rarity.SR {
  background: #f5b82e;
  color: #1b1303;
}

.rarity.R {
  background: #4c9ff0;
  color: #07111c;
}

.rarity.N {
  background: #8b98ad;
  color: #111827;
}

.cafe-badge {
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 12px;
}

.cafe-badge.placed {
  color: #6df0a8;
  background: #143828;
  border-color: #266b4c;
}

.cafe-badge.unplaced {
  color: #ff8c9e;
  background: #3b1c24;
  border-color: #6e2d3d;
}

.qty {
  height: 23px;
  padding: 0 8px;
  border-radius: 6px;
  border-color: #2d5a70;
  background: #1d3a48;
  color: #8de2fa;
  font-size: 11.5px;
  backdrop-filter: none;
}

.own-badge {
  height: 23px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  backdrop-filter: none;
}

.own-badge.craft {
  color: #ffd76e;
  border-color: #6b561f;
  background: #3a2f12;
}

.own-badge.future {
  color: var(--text-soft);
  border-color: #3a465c;
  background: #202838;
}

.chars {
  margin-top: 12px;
  gap: 7px;
}

.char {
  padding: 8px 9px 8px 7px;
  border-radius: 10px;
  border-color: #2b3648;
  background: #202938;
}

.char:hover {
  background: #263143;
  border-color: #3a4966;
}

.char.missing {
  background: #2a2028;
  border-color: #4a2c34;
}

.char.capped {
  background: #2a2518;
  border-color: #5a4b22;
}

.portrait {
  width: 46px;
  height: 52px;
  border-radius: 8px;
}

.char-name {
  font-size: 13.5px;
}

.char-sub {
  font-size: 11.5px;
}

.stars {
  font-size: 10.5px;
}

.char-sub .bond.capped {
  background: #3a2f12;
  border-color: #6b561f;
  color: #ffd76e;
}

.char-sub .bond.capped em {
  background: #ffcf5c;
  color: #1b1303;
  font-size: 8.5px;
}

.status {
  width: 28px;
  height: 28px;
  font-size: 13px;
  box-shadow: none;
}

.char.owned .status {
  background: #48e5a6;
  color: #0a1a12;
  box-shadow: none;
}

.char.missing .status {
  background: #ff6b7d;
  color: #2a0a0f;
  box-shadow: none;
}

.no-interaction {
  font-size: 12px;
}

.empty {
  background: #181f2c;
  border-color: #303d56;
}

.empty-icon {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  background: #202a3b;
  box-shadow: none;
  font-size: 30px;
}

.empty h2 {
  font-size: 24px;
}

.empty p {
  font-size: 14.5px;
}

.empty code,
.empty pre {
  font-size: 12.5px;
  background: #111722;
}

.footer {
  font-size: 12px;
}

.modal-backdrop {
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: none;
}

.modal-panel {
  background: #1a2231;
  border-color: #33415c;
  border-radius: 16px;
  box-shadow: none;
}

.modal-head h2 {
  font-size: 24px;
}

.modal-head p {
  font-size: 13px;
}

.modal-tools {
  font-size: 12px;
}

.modal-close {
  background: #232d40;
}

.cmp-table th,
.cmp-table td {
  padding: 10px 12px;
  font-size: 12.5px;
}

.cmp-table thead th {
  font-size: 11px;
  background: #1a2231;
}

.cmp-furniture {
  background: #161d29;
}

.cmp-table tbody tr:hover .cmp-furniture {
  background: #1b2434;
}

.cmp-furniture b {
  font-size: 13px;
}

.cmp-furniture small {
  font-size: 10.5px;
}

.cmp-account-head .acc-name {
  font-size: 12.5px;
}

.cmp-account-head .cmp-pieces {
  font-size: 10.5px;
}

.cmp-char {
  width: 32px;
  height: 36px;
}

.cmp-char.yes {
  box-shadow: none;
}

.cmp-count {
  font-size: 10.5px;
}

.modal-foot {
  font-size: 11px;
}

.toast {
  background: #232d40;
  border-color: #33415c;
  box-shadow: none;
  font-size: 12.5px;
}

.hero-side {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.floating-back {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 90;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--cyan);
  border-radius: 10px;
  background: var(--cyan);
  color: #07111c;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
}

.floating-back:hover {
  background: #6bd6f7;
}

.floating-back[hidden] {
  display: none;
}

.bonds-search {
  flex: 1 1 220px;
  max-width: 330px;
}

.bonds-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #303d56;
  border-radius: 8px;
  background: #151c29;
  font-size: 13px;
  outline: none;
}

.bonds-search input:focus {
  border-color: var(--cyan);
}

.bonds-count {
  color: var(--muted);
  font-size: 11.5px;
}

.bonds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  padding: 14px 22px 18px;
}

.bond-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 66px;
  padding: 8px 10px;
  border: 1px solid #2b3648;
  border-radius: 10px;
  background: #202938;
}

.bond-card.capped {
  border-color: #5a4b22;
  background: #2a2518;
}

.bond-portrait {
  flex: 0 0 auto;
  width: 44px;
  height: 50px;
  overflow: hidden;
  border: 1px solid #303d56;
  border-radius: 8px;
  background: #0a0f1a;
}

.bond-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
}

.bond-eleph {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border: 1px solid rgba(184, 146, 255, 0.35);
  border-radius: 999px;
  background: rgba(184, 146, 255, 0.1);
  color: #c9b6ff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bond-eleph.ready {
  border-color: rgba(72, 229, 166, 0.45);
  background: rgba(72, 229, 166, 0.12);
  color: var(--green);
}

.bond-eleph.unknown {
  opacity: 0.55;
}

.bond-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bond-card.capped .bond-info {
  padding-right: 38px;
}

.bond-card.has-exp.capped .bond-info {
  padding-right: 0;
}

.bond-card.has-exp.capped .bond-cap {
  display: none;
}

.bond-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 650;
}

.bond-name-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.bond-name-row .bond-name {
  flex: 0 1 auto;
  min-width: 0;
}

.bond-exp-pct {
  flex: 0 0 auto;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.bond-exp-pct.max {
  color: var(--bond-max);
}

.bond-exp-pct.unknown {
  color: var(--muted);
  font-weight: 600;
}

.bond-days {
  flex: 0 0 auto;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(232, 185, 106, 0.16);
  color: #e8b96a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bond-days.unknown {
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.bond-days.max {
  background: rgba(183, 116, 219, 0.18);
  color: var(--bond-max);
}

.bond-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.bond-value {
  color: var(--gold);
  font-weight: 650;
}

.bond-cap {
  position: absolute;
  right: 8px;
  top: 8px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--gold);
  color: #1b1303;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Stars, bonds, priorities and the craft plan
   -------------------------------------------------------------------------- */

:root {
  --star-5: #839ade;
  --star-4: #84d9b8;
  --star-3: #dbcc65;
  --star-2: #ffffff;
  --bond-max: rgb(183, 116, 219);
  --bond-40: #839ade;
  --bond-30: #84d9b8;
  --bond-20: #dbcc65;
  --bond-0: #ffffff;
}

.stars.star-5 {
  color: var(--star-5);
}

.stars.star-4 {
  color: var(--star-4);
}

.stars.star-3 {
  color: var(--star-3);
}

.stars.star-2 {
  color: var(--star-2);
}

.char-name,
.bond-name {
  color: var(--text);
}

.char-sub .bond,
.bond-value {
  color: var(--bond-0);
  font-weight: 700;
}

.char-sub .bond.bond-20,
.bond-value.bond-20 {
  color: var(--bond-20);
}

.char-sub .bond.bond-30,
.bond-value.bond-30 {
  color: var(--bond-30);
}

.char-sub .bond.bond-40,
.bond-value.bond-40 {
  color: var(--bond-40);
}

.char-sub .bond.bond-max,
.bond-value.bond-max {
  color: var(--bond-max);
  font-weight: 850;
}

.char.owned .status.max {
  background: var(--gold);
  color: #1b1303;
}

.status.max .pause {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.status.max .pause i {
  display: block;
  width: 3px;
  height: 11px;
  border-radius: 2px;
  background: #1b1303;
}

.qty {
  justify-content: center;
  min-width: 28px;
  height: 27px;
  padding: 0 8px;
  font-size: 15px;
  font-weight: 850;
}

.cmp-qty {
  color: #8de2fa;
  font-size: 13px;
  font-weight: 850;
}

.priority-bang {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--gold);
  color: #1b1303;
  font-size: 12px;
  font-weight: 900;
  font-style: normal;
  line-height: 1;
  vertical-align: 1px;
}

.hero-meta .chip.plans {
  color: var(--bond-max);
  border-color: rgba(183, 116, 219, 0.45);
  background: rgba(183, 116, 219, 0.12);
}

.hero-meta .chip.plans:hover {
  color: #e7d4f4;
  border-color: rgba(183, 116, 219, 0.7);
  background: rgba(183, 116, 219, 0.22);
}

.fcard-plan {
  margin-top: 10px;
}

.plan-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 31px;
  padding: 0 11px;
  border: 1px solid #3a465c;
  border-radius: 8px;
  background: #232d40;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.plan-btn:hover {
  background: #2b374d;
  border-color: var(--bond-max);
  color: var(--text);
}

.plan-btn.active {
  border-color: var(--bond-max);
  background: rgba(183, 116, 219, 0.18);
  color: #ddc6f0;
}

.btn.small {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12.5px;
}

.btn.danger {
  color: #ffb3bd;
  border-color: #6a3941;
  background: #2a2028;
}

.btn.danger:hover {
  color: #ffd0d6;
  border-color: #8a4a55;
  background: #35252c;
}

.plan-panel {
  width: min(1000px, 96vw);
}

.plan-search {
  max-width: 360px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  padding: 14px 22px 6px;
}

.plan-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 74px;
  padding: 9px 42px 9px 10px;
  border: 1px solid #2b3648;
  border-radius: 10px;
  background: #202938;
}

.plan-img {
  flex: 0 0 auto;
  width: 56px;
  height: 46px;
  object-fit: contain;
}

.plan-card-body {
  flex: 1;
  min-width: 0;
}

.plan-card-name {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.25;
}

.plan-card-name a {
  color: inherit;
}

.plan-card-name a:hover {
  color: var(--cyan);
}

.plan-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.plan-card-meta .rarity {
  height: 19px;
  padding: 0 6px;
  font-size: 9px;
}

.plan-card-meta .cafe-badge {
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  font-size: 10px;
}

.plan-owned.yes {
  color: var(--green);
}

.plan-owned.no {
  color: #ff9aa7;
}

.plan-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid #3a465c;
  border-radius: 7px;
  background: #232d40;
  color: var(--text-soft);
  font-size: 12px;
  cursor: pointer;
}

.plan-remove:hover {
  border-color: #8a4a55;
  background: #3a2530;
  color: #ffb3bd;
}

.plan-add-list {
  display: flex;
  flex-direction: column;
  padding: 8px 14px 6px;
}

.plan-add-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.plan-add-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.plan-add-row.in-plan {
  background: rgba(183, 116, 219, 0.07);
}

.plan-add-row img {
  flex: 0 0 auto;
  width: 42px;
  height: 34px;
  object-fit: contain;
}

.plan-add-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.plan-add-row .rarity {
  flex: 0 0 auto;
  height: 20px;
  padding: 0 6px;
  font-size: 9px;
}

.plan-tag {
  flex: 0 0 auto;
  padding: 1px 6px;
  border: 1px solid rgba(72, 229, 166, 0.35);
  border-radius: 999px;
  background: rgba(72, 229, 166, 0.1);
  color: var(--green);
  font-size: 9px;
  font-weight: 700;
}

.plan-add-state {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid #3a465c;
  border-radius: 7px;
  background: #232d40;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 800;
}

.plan-add-row.in-plan .plan-add-state {
  border-color: var(--bond-max);
  background: rgba(183, 116, 219, 0.18);
  color: #ddc6f0;
}

.plan-empty {
  margin: 18px 22px;
}

.bond-card.capped {
  border-color: rgba(183, 116, 219, 0.45);
  background: rgba(183, 116, 219, 0.09);
}

.bond-cap {
  background: var(--bond-max);
  color: #120a1c;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

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

  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    overflow-x: auto;
  }

  .brand {
    flex: 0 0 auto;
    padding: 0;
  }

  .brand h1,
  .brand span,
  .sidebar-label,
  .sidebar-note,
  .sidebar-spacer {
    display: none;
  }

  .accounts {
    flex-direction: row;
    gap: 6px;
  }

  .account {
    flex: 0 0 auto;
    width: auto;
    padding: 5px 9px 5px 5px;
  }

  .account.active {
    box-shadow: inset 0 -3px 0 var(--accent);
  }

  .account-avatar {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 14px;
  }

  .account-sub,
  .account-dot {
    display: none;
  }

  .account-name {
    font-size: 13.5px;
  }

  .main {
    padding: 22px 16px 32px;
  }

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

  .hero {
    flex-direction: column;
    gap: 16px;
  }

  .hero-side {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 620px) {
  .hero-main {
    align-items: flex-start;
  }

  .account-avatar.big {
    width: 56px;
    height: 56px;
    font-size: 22px;
    border-radius: 15px;
  }

  .hero h1 {
    font-size: 30px;
  }

  .hero-side {
    align-items: stretch;
    gap: 10px;
  }

  #bondsBtn {
    flex: 1 1 auto;
  }

  #compareBtn {
    flex: 1 1 100%;
  }

  .stats {
    gap: 8px;
  }

  .stat {
    padding: 10px 12px;
  }

  .stat-label {
    white-space: normal;
    line-height: 1.3;
  }

  .stat-value strong {
    font-size: 23px;
  }

  .segmented {
    scrollbar-width: none;
  }

  .segmented::-webkit-scrollbar {
    display: none;
  }

  .toolbar {
    align-items: stretch;
  }

  .search {
    max-width: none;
    flex-basis: 100%;
  }

  .segmented {
    overflow-x: auto;
    max-width: 100%;
  }

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

  .fcard-top {
    height: 154px;
  }

  .modal {
    padding: 8px;
  }

  .modal-panel {
    max-height: 96vh;
    border-radius: 16px;
  }
}

@media (max-width: 620px) {
  .plan-grid {
    grid-template-columns: 1fr;
    padding: 10px 12px 4px;
  }

  .plan-add-list {
    padding: 6px 8px;
  }

  .plan-add-row .rarity {
    display: none;
  }

  .plan-add-name {
    font-size: 12px;
  }

  .plan-card {
    padding-right: 38px;
  }

  .plan-search {
    max-width: none;
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- event planner link in the sidebar ---------- */
.sidebar-planner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 4px;
  padding: 10px 11px;
  border: 1px solid rgba(232, 185, 106, 0.28);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(232, 185, 106, 0.12), rgba(76, 201, 240, 0.05));
  color: var(--text, #e9f0fa);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.sidebar-planner:hover {
  border-color: rgba(232, 185, 106, 0.6);
  background: linear-gradient(135deg, rgba(232, 185, 106, 0.2), rgba(76, 201, 240, 0.08));
  color: var(--text, #e9f0fa);
  transform: translateY(-1px);
}
.sidebar-planner-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: rgba(9, 16, 26, 0.55);
  font-size: 18px;
  line-height: 1;
}
.sidebar-planner-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sidebar-planner-text strong { font-size: 13px; }
.sidebar-planner-text small { margin-top: 2px; color: var(--muted, #8fa3bf); font-size: 10.5px; }
.sidebar-planner-arrow { margin-left: auto; color: var(--sand, #e8b96a); font-size: 16px; }


/* ==========================================================================
   Cloud multi-user UI (auth, BA account manager, import guide)
   ========================================================================== */

.cloud-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #1b2332;
  border: 1px solid #2c3952;
}

.cloud-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cloud-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cloud-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(76, 201, 240, 0.18);
  color: var(--cyan);
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 28px;
}

.cloud-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-user-sub {
  font-size: 11px;
  color: var(--muted);
}

.cloud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cloud-btn {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid #32425e;
  background: #232e43;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.cloud-btn:hover {
  background: #2a3750;
  border-color: #465b80;
}

.cloud-btn.primary {
  background: rgba(76, 201, 240, 0.18);
  border-color: rgba(76, 201, 240, 0.55);
  color: #d8f4ff;
}

.cloud-btn.primary:hover {
  background: rgba(76, 201, 240, 0.28);
}

.cloud-btn.danger {
  background: rgba(255, 107, 125, 0.12);
  border-color: rgba(255, 107, 125, 0.4);
  color: #ffb0ba;
}

.cloud-btn.danger:hover {
  background: rgba(255, 107, 125, 0.24);
}

.cloud-btn.icon-only {
  flex: 0 0 auto;
  padding: 5px 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.cloud-modal-panel {
  max-width: 520px;
}

.cloud-guide-panel {
  max-width: 680px;
}

.cloud-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 11px;
  background: #141b28;
  border: 1px solid #28344a;
}

.cloud-tab {
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
}

.cloud-tab.active {
  background: #243047;
  color: var(--text);
}

.cloud-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.cloud-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cloud-field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
}

.cloud-field input[type="text"],
.cloud-field input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #303d56;
  background: #121824;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.cloud-field input:focus {
  border-color: var(--cyan);
}

.cloud-hint {
  font-size: 12px;
  color: var(--muted);
}

.cloud-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--red-soft);
  border: 1px solid rgba(255, 107, 125, 0.4);
  color: #ffc1c9;
  font-size: 13px;
}

.cloud-success {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--green-soft);
  border: 1px solid rgba(72, 229, 166, 0.35);
  color: #bdf7de;
  font-size: 13px;
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 22px 16px;
  border-radius: 12px;
  border: 1.5px dashed #3e5072;
  background: #131a27;
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--cyan);
  background: rgba(76, 201, 240, 0.08);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone strong {
  font-size: 14px;
  color: var(--text);
}

.dropzone span {
  font-size: 12.5px;
  color: var(--muted);
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.color-swatch.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(76, 201, 240, 0.5);
}

.cloud-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.cloud-form-foot .right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.guide-step {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #141b28;
  border: 1px solid #28344a;
}

.guide-num {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(76, 201, 240, 0.16);
  color: var(--cyan);
  font-weight: 800;
  font-size: 13px;
  flex: 0 0 28px;
}

.guide-step h3 {
  margin: 0 0 4px;
  font-size: 14.5px;
  color: var(--text);
}

.guide-step p {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

.guide-step code {
  padding: 1px 6px;
  border-radius: 6px;
  background: #1f2a3e;
  color: #bfefff;
  font-size: 12px;
}

.guide-download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.guide-security {
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(72, 229, 166, 0.08);
  border: 1px solid rgba(72, 229, 166, 0.28);
}

.guide-security h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: #8af3c6;
}

.guide-security ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.demo-chip {
  background: rgba(255, 207, 92, 0.14) !important;
  border-color: rgba(255, 207, 92, 0.4) !important;
  color: #ffe299 !important;
}

/* ==========================================================================
   Gifts & Gift Calculator modals
   ========================================================================== */

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

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.gifts-panel,
.giftcalc-panel {
  width: min(1240px, 96vw);
}

.gifts-search {
  flex: 1 1 240px;
  max-width: 340px;
}

.gift-banner {
  margin: 12px 20px 2px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid rgba(255, 207, 92, 0.35);
  background: rgba(255, 207, 92, 0.1);
  color: #ffe299;
  font-size: 12.5px;
}

/* -- Gifts catalog grid -- */

.gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
  padding: 14px 20px 6px;
  align-items: start;
}

.gift-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #141c2d;
  transition: border-color 150ms ease, background 150ms ease;
}

.gift-card:hover {
  border-color: rgba(159, 186, 255, 0.28);
}

.gift-card.kind-choice_box {
  border-color: rgba(76, 201, 240, 0.36);
  background: #142235;
}

.gift-card.kind-ssr,
.gift-card.kind-bouquet {
  border-color: rgba(168, 120, 255, 0.28);
}

.gift-card.is-zero {
  opacity: 0.62;
}

.gift-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.gift-icon-wrap {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #0d1423;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px;
}

.gift-icon-wrap.kind-sr {
  background: #232018;
  border-color: rgba(255, 198, 72, 0.38);
}

.gift-icon-wrap.kind-ssr,
.gift-icon-wrap.kind-bouquet {
  background: #1d172c;
  border-color: rgba(168, 110, 255, 0.44);
}

.gift-icon-wrap.kind-choice_box {
  background: #102433;
  border-color: rgba(76, 201, 240, 0.48);
}

.gift-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gift-head-info {
  min-width: 0;
  flex: 1;
}

.gift-head-info h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 680;
  line-height: 1.25;
}

.gift-head-info h3 a {
  color: var(--text);
}

.gift-head-info h3 a:hover {
  color: var(--cyan);
  text-decoration: none;
}

.gift-head-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.gift-head-meta .rarity {
  height: 18px;
  padding: 0 6px;
  font-size: 8.5px;
}

.gift-head-meta .rarity.SSR {
  background: #a86eff;
  color: #120624;
}

.rarity.gift-choice-tag {
  background: #4cc9f0;
  color: #041320;
}

.gift-base-note {
  color: var(--muted);
  font-size: 10.5px;
}

.gift-qty-pill {
  flex: 0 0 auto;
  min-width: 44px;
  height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.gift-qty-pill.has-qty {
  border-color: rgba(76, 201, 240, 0.42);
  background: rgba(76, 201, 240, 0.14);
  color: #b7eeff;
}

.gift-special-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.45;
}

.gift-special-note.choice {
  border-color: rgba(76, 201, 240, 0.34);
  background: rgba(76, 201, 240, 0.06);
}

.gift-special-note.bouquet {
  justify-content: flex-start;
  border-color: rgba(168, 110, 255, 0.34);
  background: rgba(168, 110, 255, 0.08);
}

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

.gift-tier-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.gift-tier-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gift-tier-cnt {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.gift-exp-pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tier-240 {
  background: rgba(192, 92, 235, 0.26);
  border: 1px solid rgba(232, 121, 249, 0.55);
  color: #f8c6ff;
}

.tier-180 {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(167, 139, 250, 0.45);
  color: #d7c4ff;
}

.tier-80 {
  background: rgba(255, 116, 158, 0.24);
  border: 1px solid rgba(255, 130, 178, 0.58);
  color: #ffd3e5;
}

.tier-60 {
  background: rgba(255, 207, 92, 0.18);
  border: 1px solid rgba(255, 207, 92, 0.46);
  color: #ffe399;
}

.tier-40 {
  background: rgba(76, 201, 240, 0.14);
  border: 1px solid rgba(76, 201, 240, 0.38);
  color: #b4ebff;
}

.tier-muted {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #9aa7bd;
}

.gift-char-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.gift-char {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 152px;
  padding: 2px 7px 2px 2px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 560;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.gift-char:hover {
  border-color: rgba(76, 201, 240, 0.55);
  background: rgba(76, 201, 240, 0.1);
  color: var(--text);
  transform: translateY(-1px);
}

.gift-char.owned {
  border-color: rgba(72, 229, 166, 0.38);
  background: rgba(72, 229, 166, 0.075);
  color: var(--text);
}

.gift-char.missing {
  opacity: 0.62;
}

.gift-char.missing img {
  filter: grayscale(0.55) brightness(0.76);
}

.gift-char.is-match {
  opacity: 1;
  border-color: var(--cyan);
  background: rgba(76, 201, 240, 0.18);
  box-shadow: 0 0 0 1px rgba(76, 201, 240, 0.35);
}

.gift-char img {
  flex: 0 0 auto;
  width: 24px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
  object-position: 50% 18%;
  display: block;
}

.gift-char-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gift-char-more {
  height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.gift-char-more:hover {
  border-color: var(--cyan);
  background: rgba(76, 201, 240, 0.12);
}

/* -- Gift calculator modal -- */

.calc-pick-section,
.calc-section {
  padding: 12px 20px 6px;
}

.calc-section-title {
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.calc-section-title.muted {
  color: var(--muted);
}

.calc-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 8px;
}

.calc-pick-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px 7px 7px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.calc-pick-card:hover {
  border-color: rgba(76, 201, 240, 0.55);
  background: rgba(76, 201, 240, 0.09);
  transform: translateY(-1px);
}

.calc-pick-card.active {
  border-color: var(--cyan);
  background: rgba(76, 201, 240, 0.14);
}

.calc-pick-card.missing {
  opacity: 0.72;
}

.calc-pick-card.missing .bond-portrait img {
  filter: grayscale(0.5) brightness(0.8);
}

.calc-pick-box {
  margin-left: auto;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 750;
}

.calc-summary {
  display: grid;
  grid-template-columns: minmax(270px, 1fr) minmax(360px, 1.45fr);
  gap: 14px;
  margin: 14px 20px 6px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(76, 201, 240, 0.28);
  background: linear-gradient(135deg, rgba(23, 35, 58, 0.94), rgba(15, 22, 36, 0.96));
}

.calc-char-block {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.calc-char-portrait {
  flex: 0 0 auto;
  width: 68px;
  height: 78px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #0a0f1a;
}

.calc-char-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 16%;
  display: block;
}

.calc-char-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calc-char-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 18px;
  font-weight: 740;
  line-height: 1.15;
}

.calc-char-title a {
  color: var(--text);
}

.calc-char-title a:hover {
  color: var(--cyan);
}

.calc-unowned-pill {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 107, 125, 0.4);
  background: rgba(255, 107, 125, 0.12);
  color: #ffb0bc;
  font-size: 10px;
  font-weight: 700;
}

.calc-char-sub {
  color: var(--text-soft);
  font-size: 12px;
}

.calc-fav-gift {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 7px;
  margin-top: 2px;
}

.calc-fav-label {
  color: var(--muted);
}

.calc-fav-list {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
}

.calc-fav-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px 2px 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(9, 14, 24, 0.55);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
}

.calc-fav-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 auto;
  display: block;
}

.calc-inline-exp {
  display: inline-block;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 11px;
}

.calc-cap-warn {
  margin-top: 2px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 207, 92, 0.35);
  background: rgba(255, 207, 92, 0.1);
  color: #ffe299;
  font-size: 11px;
  line-height: 1.35;
}

.calc-result-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}

.calc-bond-transition {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.calc-bond-box,
.calc-exp-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 13, 24, 0.6);
}

.calc-bond-box span,
.calc-exp-box span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calc-bond-box strong {
  margin-top: 2px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.calc-bond-box.before strong {
  color: var(--text-soft);
}

.calc-bond-box.after {
  border-color: rgba(72, 229, 166, 0.48);
  background: rgba(72, 229, 166, 0.09);
}

.calc-bond-box.after strong {
  color: var(--green);
}

.calc-bond-box.after em {
  font-style: normal;
  color: #a6f7d4;
  font-size: 10.5px;
  font-weight: 700;
}

.calc-arrow {
  color: var(--cyan);
  font-size: 20px;
  font-weight: 800;
}

.calc-exp-box {
  margin-left: auto;
  border-color: rgba(76, 201, 240, 0.36);
  background: rgba(76, 201, 240, 0.08);
}

.calc-exp-box strong {
  margin-top: 2px;
  color: #a8ebff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.calc-exp-box small {
  color: var(--muted);
  font-size: 10.5px;
}

.calc-progress {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.calc-progress-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 11px;
}

.calc-progress-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.calc-progress-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
}

.calc-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.calc-tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
}

.calc-gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 9px;
}

.calc-gift-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(24, 33, 52, 0.85);
}

.calc-gift-card.is-choice-box {
  border-color: rgba(76, 201, 240, 0.45);
  background: rgba(22, 41, 64, 0.88);
}

.calc-gift-card.is-zero {
  opacity: 0.55;
}

.calc-gift-card.is-excluded {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(18, 23, 34, 0.58);
  opacity: 0.56;
  filter: grayscale(0.85);
}

.calc-gift-card.is-excluded:hover {
  opacity: 0.78;
}

.calc-gift-icon {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 4px;
  border-radius: 10px;
  background: rgba(9, 14, 24, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.calc-gift-icon.kind-sr {
  border-color: rgba(255, 198, 72, 0.35);
}

.calc-gift-icon.kind-ssr,
.calc-gift-icon.kind-bouquet {
  border-color: rgba(168, 110, 255, 0.42);
}

.calc-gift-icon.kind-choice_box {
  border-color: rgba(76, 201, 240, 0.5);
}

.calc-gift-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.calc-gift-exp {
  position: absolute;
  right: -5px;
  bottom: -5px;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 850;
  line-height: 1.25;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.calc-gift-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calc-gift-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text);
}

.calc-gift-hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10.5px;
}

.calc-gift-nums {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}

.calc-gift-qty {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 760;
}

.calc-gift-sub {
  color: var(--green);
  font-size: 11.5px;
  font-weight: 760;
}

.calc-gift-sub.muted {
  color: var(--muted);
  font-weight: 600;
}

.calc-empty-inline {
  padding: 18px 12px;
  margin: 0;
}

.calc-recraft-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 15px;
  border: 1px solid rgba(255, 207, 92, 0.36);
  background: linear-gradient(135deg, rgba(46, 39, 24, 0.56), rgba(20, 29, 46, 0.92));
}

.calc-recraft-card.is-muted {
  border-color: var(--line-soft);
  background: rgba(20, 26, 38, 0.72);
  opacity: 0.76;
}

.calc-recraft-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.calc-recraft-icon {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 4px;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 45%, rgba(255, 207, 92, 0.24), rgba(10, 15, 27, 0.86) 75%);
  border: 1px solid rgba(255, 207, 92, 0.45);
}

.calc-recraft-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.calc-recraft-info {
  flex: 1 1 140px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calc-recraft-title {
  font-size: 14px;
  font-weight: 720;
  color: #ffe49c;
  line-height: 1.25;
}

.calc-recraft-sub {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.calc-recraft-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

.calc-bond-box.recraft-gain {
  border-color: rgba(255, 207, 92, 0.4);
  background: rgba(255, 207, 92, 0.09);
}

.calc-bond-box.recraft-gain strong {
  color: #ffe299;
  font-size: 18px;
}

.calc-bond-box.recraft-gain small {
  color: var(--muted);
  font-size: 10.5px;
}

.calc-bond-box.recraft-bond strong {
  font-size: 20px;
}

.calc-progress-bar.recraft-bar i {
  background: linear-gradient(90deg, var(--gold), var(--green));
}

@media (max-width: 920px) {
  .calc-summary {
    grid-template-columns: 1fr;
  }

  .calc-exp-box {
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .hero-actions {
    width: 100%;
    justify-content: stretch;
  }

  #giftsBtn,
  #giftCalcBtn,
  #bondsBtn {
    flex: 1 1 auto;
  }

  .gifts-grid {
    grid-template-columns: 1fr;
    padding: 10px 12px 6px;
  }

  .calc-pick-section,
  .calc-section {
    padding: 10px 12px 6px;
  }

  .calc-summary {
    margin: 10px 12px 6px;
    padding: 12px;
  }

  .calc-gifts-grid,
  .calc-pick-grid {
    grid-template-columns: 1fr;
  }
}
