:root {
  --bg: #0b0f1a;
  --bg-panel: rgba(15, 23, 42, 0.8);
  --bg-card: rgba(30, 41, 59, 0.5);
  --bg-card-hover: rgba(51, 65, 85, 0.6);
  --bg-active: rgba(37, 99, 235, 0.2);
  --border: rgba(255, 255, 255, 0.08);
  --border-active: #3b82f6;
  --text-main: #f1f5f9;
  --text-sub: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  background-image:
    radial-gradient(at 0% 0%, rgba(30, 58, 138, 0.2) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(88, 28, 135, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
}

.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 380px;
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  letter-spacing: 0.5px;
}

.sidebar-header p {
  margin: 0;
  color: var(--text-sub);
  font-size: 0.85rem;
}

.config-section {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.config-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-select,
.form-input {
  width: 100%;
  padding: 0.75rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-select:focus,
.form-input:focus {
  border-color: var(--accent);
}

.owned-summary {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
}

.owned-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
}

.owned-item-cost {
  color: #fbbf24;
  font-weight: bold;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  padding-right: 1.5rem;
}

.tab-list {
  display: flex;
}

.tab {
  padding: 1rem 2rem;
  cursor: pointer;
  color: var(--text-sub);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab.active {
  color: var(--text-main);
  border-bottom-color: var(--accent);
}

.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* Eiketsu Grid */
.e-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.e-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  backdrop-filter: blur(8px);
}

.e-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-6px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
}

.e-card.owned {
  background: var(--bg-active);
  border-color: var(--border-active);
}

/* Image Placeholder */
.e-image-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.e-image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.e-card:hover .e-image-placeholder img {
  transform: scale(1.05);
}

.e-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.25rem;
}

.e-name {
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.2;
}

.e-cost-info {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.final-cost {
  color: #fbbf24;
  font-weight: bold;
}

.lb-selector-wrapper {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.lb-selector {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 0 2px;
}

.lb-line {
  position: absolute;
  top: 50%;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--border);
  transform: translateY(-50%);
  z-index: 1;
}

.lb-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-sub);
  position: relative;
  z-index: 2;
  transition: all 0.2s;
}

.lb-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Results */
.r-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem; /* Further compressed */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.r-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.8rem;
}

.r-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}

.r-status-badges {
  display: flex;
  gap: 0.75rem;
}

.r-status-badge {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  overflow: hidden;
  height: 24px;
}

.r-badge-label {
  background: var(--accent);
  color: #000;
  padding: 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 900;
  height: 100%;
  display: flex;
  align-items: center;
  text-shadow: none;
}

.r-badge-val {
  padding: 0 0.5rem;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 800;
  font-family: 'Roboto Mono', monospace;
}

.r-status-badge.bond-count .r-badge-label {
  background: #ec4899;
  color: #fff;
}
.r-status-badge.bond-count .r-badge-val {
  color: #f472b6;
}

.r-score {
  display: none;
}

.r-meta {
  color: var(--text-sub);
  font-size: 0.9rem;
}

.r-body {
  display: flex;
  gap: 1.5rem;
  padding: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* 3谿ｵ讒区・縺ｮ莉募・繧・*/
}

/* 闍ｱ蛯代い繧､繧ｳ繝ｳ繧偵Λ繝・・縺励※繝舌ャ繧ｸ繧帝・鄂ｮ */
.r-eiketsu-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.r-lb-badge {
  position: absolute;
  top: -6px; /* 蟆代＠菴呵｣輔ｒ謖√◆縺帙ｋ */
  left: -6px;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #000;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  border: 1.5px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  z-index: 10;
  line-height: 1;
}

/* 0蜃ｸ縺ｮ蝣ｴ蜷医・蟆代＠謗ｧ縺医ａ縺ｫ・医∪縺溘・陦ｨ遉ｺ縺励↑縺・ｴ蜷医・JSX縺ｧ蛻ｶ蠕｡・・*/
.r-lb-badge.zero {
  background: #64748b;
  color: #fff;
}

.r-bonds-section {
  padding: 1rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  background: rgba(45, 212, 191, 0.03); /* 縺ｻ繧薙・繧顔ｷ醍ｳｻ縺ｮ閭梧勹 */
}

.r-bond-tag {
  background: rgba(45, 212, 191, 0.1);
  color: #5eead4;
  border: 1px solid rgba(45, 212, 191, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
}

.r-bond-tag:hover {
  background: rgba(45, 212, 191, 0.2);
  transform: translateY(-1px);
}

.r-bond-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #2dd4bf;
  border-radius: 50%;
}

@media (max-width: 768px) {
  .r-body {
    flex-direction: column;
  }
}

.r-grid {
  flex: 0 0 250px;
  position: relative;
  width: 250px;
  height: 220px; /* Further compressed height */
  margin: 0; /* Left aligned */
}

/* Gyorin (Triangle) - Condensed Pyramid */
.formation-gyorin .pos-0 { top: 0px;   left: 50%; transform: translateX(-50%); } 
.formation-gyorin .pos-1 { top: 80px;  left: 72%; transform: translateX(-50%); } 
.formation-gyorin .pos-2 { top: 160px; left: 88%; transform: translateX(-50%); } 
.formation-gyorin .pos-3 { top: 160px; left: 50%; transform: translateX(-50%); } 
.formation-gyorin .pos-4 { top: 160px; left: 12%; transform: translateX(-50%); } 
.formation-gyorin .pos-5 { top: 80px;  left: 28%; transform: translateX(-50%); } 

/* Hoen (Hexagon) - Condensed & Stretched */
.formation-hoen .pos-1 { top: 0px;   left: 50%; transform: translateX(-50%); } /* Top */
.formation-hoen .pos-2 { top: 60px;  left: 82%; transform: translateX(-50%); } /* R-Upper */
.formation-hoen .pos-3 { top: 140px; left: 82%; transform: translateX(-50%); } /* R-Lower */
.formation-hoen .pos-4 { top: 200px; left: 50%; transform: translateX(-50%); } /* Bottom */
.formation-hoen .pos-5 { top: 140px; left: 18%; transform: translateX(-50%); } /* L-Lower */
.formation-hoen .pos-0 { top: 60px;  left: 18%; transform: translateX(-50%); } /* L-Upper */

.r-eiketsu {
  position: absolute;
  width: 75px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.r-eiketsu:hover {
  background: rgba(255, 255, 255, 0.08); /* 閭梧勹繧貞ｰ代＠譏弱ｋ縺上☆繧九□縺代↓縺吶ｋ */
  border-color: var(--accent);
  z-index: 10;
}

.r-eiketsu-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.3);
  display: block;
  border-radius: 6px 6px 0 0; /* 荳企Κ隗剃ｸｸ繧堤ｶｭ謖・*/
}

.r-eiketsu-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.75); /* 繧医ｊ隱ｭ縺ｿ繧・☆縺・*/
  backdrop-filter: blur(2px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 1px;
  white-space: normal;
  line-height: 1.1;
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.r-eiketsu-cost {
  display: none; /* Hidden as per request */
}

.r-bonds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.r-stats {
  flex: 1; /* Take remaining space */
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid var(--border);
  min-width: 200px;
}

.r-stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--text-main);
}

.r-stats-row {
  display: flex;
  gap: 1rem 1.8rem;
  flex-wrap: wrap;
}

.r-stat-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 90px;
}

.r-stat-item {
  display: flex;
  align-items: center;
  gap: 0.8rem; /* 繝ｩ繝吶Ν縺ｨ謨ｰ蛟､縺ｮ髢薙・霍晞屬繧堤強縺・*/
  font-size: 0.8rem;
  padding: 0.1rem 0;
}

.r-stat-label {
  color: var(--text-muted);
  min-width: 3.2em; /* 繝ｩ繝吶Ν縺ｮ蟷・ｒ蝗ｺ螳壹＠縺ｦ謨ｰ蛟､繧堤ｸｦ縺ｫ謠・∴繧・*/
}

.r-stat-val {
  font-family: 'Roboto Mono', 'Source Code Pro', monospace;
  font-weight: 800;
  color: #3b82f6;
  font-size: 0.85rem;
}

.r-bond-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.info-tip {
  display: inline-flex;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  color: #000;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: help;
  position: relative;
  margin-left: 4px;
}

.info-tip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 120%;
  right: 0;
  width: 200px;
  background: #1e293b;
  color: #fff;
  padding: 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: normal;
  border: 1px solid var(--accent);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  z-index: 100;
  pointer-events: none;
}

.search-bar {
  width: 100%;
  padding: 1rem;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 250px;
  max-width: 400px;
  padding: 0.8rem 1.2rem;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  color: white;
  outline: none;
  font-size: 1rem;
}

.grade-filters {
  display: flex;
  gap: 0.5rem;
}

.grade-btn {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.grade-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 10px var(--accent-glow);
}

.bulk-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.bulk-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.bulk-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--text-muted);
}

.bulk-btn.danger {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.bulk-btn.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

@media (max-width: 768px) {
  .bulk-actions {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
  .bulk-btn {
    flex: 1;
    text-align: center;
  }
}

.bond-filters {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.bond-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
}

.bond-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 10px var(--accent-glow);
}

.r-filter-bar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  border-radius: 12px 12px 0 0;
  margin-bottom: 0.5rem;
}

.m-filters-box {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1rem;
}

.m-filter-row {
  display: flex;
  gap: 1rem;
}

.m-filter-row > div {
  flex: 1; /* 繧ｻ繝ｬ繧ｯ繝医・繝・け繧ｹ繧貞插遲峨↓荳ｦ縺ｹ繧・*/
}

.res-filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.res-filter-item label {
  font-size: 0.75rem;
  color: var(--text-sub);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.res-filter-item.checkbox-item {
  flex-direction: row;
  align-items: center;
  margin-top: auto;
  padding-bottom: 0.5rem;
}

.res-filter-item .form-select {
  padding: 0.5rem 2rem 0.5rem 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  font-size: 0.9rem;
}

.csv-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn-csv {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-sub);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.checkbox-group {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 35px;
  cursor: pointer;
  font-size: 0.95rem;
  user-select: none;
  color: var(--text-main);
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 22px;
  width: 22px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s;
}

.checkbox-container input:checked~.checkmark {
  background-color: var(--accent);
  border-color: var(--accent);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked~.checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.tab-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-contribution,
.btn-feedback {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-sub);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-contribution:hover,
.btn-feedback:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  color: white;
}

/* Results List Layout */
.r-list {
  display: flex;
  flex-direction: column;
  gap: 2rem; /* Larger gap between cards */
  padding: 1rem 0;
}

@media (min-width: 1024px) {
  .r-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem;
    align-items: start;
  }
}

.copyright-footer {
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================================ */
/* MOBILE - SCALED FOR HARD SEPARATION                         */
/* ============================================================ */

@media (max-width: 768px) {
  .mobile-root {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg);
    overflow: hidden;
  }

  .mobile-header {
    background: var(--bg-panel);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
  }

  .mobile-header h1 {
    font-size: 1.1rem;
    margin: 0;
    letter-spacing: 1px;
  }

  .mobile-sidebar {
    background: transparent;
  }

  .collapsible-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-sub);
  }

  .mobile-inventory-list {
    padding: 0 1rem 1rem;
  }

  .owned-item-mobile {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.8rem;
  }

  .owned-cost {
    color: #fbbf24;
  }

  .no-padding {
    padding: 0 !important;
  }

  /* Grid for Mobile Cards */
  .m-grid-container {
    padding: 1rem;
  }

  .m-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }

  .m-card {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border);
  }

  .m-card.owned {
    border-color: var(--accent);
  }

  .m-card-image {
    width: 100%;
    height: 100%;
  }

  .m-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
  }

  .m-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.6rem 0.3rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, transparent 40%, transparent 60%, rgba(0, 0, 0, 0.9) 100%);
    align-items: center;
    text-align: center;
  }

  .m-name {
    font-size: 0.75rem;
    /* Reduced from 0.85rem */
    font-weight: bold;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }

  .m-cost {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.2);
    /* Changed from white to gray */
    font-weight: bold;
    margin-bottom: 4px;
  }

  .m-cost-val {
    color: #fbbf24;
    /* Numbers stay gold */
  }

  .m-lb-slider-container {
    position: relative;
    width: 100%;
    height: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }

  .m-lb-slider {
    position: absolute;
    top: 0;
    left: 2%;
    /* Symmetrical offset for 96% width */
    width: 96%;
    height: 100%;
    opacity: 0;
    z-index: 2;
    cursor: pointer;
    margin: 0;
  }

  .m-lb-dots {
    display: flex;
    justify-content: space-between;
    gap: 0;
    position: relative;
    width: 96%;
    /* Maximize spacing in 4-column grid */
    padding: 0;
    pointer-events: none;
  }

  .m-lb-dots::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 0;
  }

  .m-lb-dot {
    font-size: 0.75rem;
    /* Slightly smaller to increase perceived gap */
    color: rgba(255, 255, 255, 0.2);
    background: transparent;
    line-height: 1;
    z-index: 1;
    transition: all 0.2s;
    user-select: none;
  }

  .m-lb-dot.active {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
    transform: scale(1.3);
  }

  .mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
  }

  .mobile-inventory-list {
    padding: 0 1rem 1rem;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
  }

  .mobile-inventory-scroll {
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
  }

  .m-filters-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
  }

  /* Mobile Results Cards */
  .r-card-mobile {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .r-header-mobile {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
  }

  .r-score-mobile {
    font-weight: bold;
    color: #34d399;
  }

  .r-meta-mobile {
    font-size: 0.75rem;
    color: var(--text-sub);
  }

  .r-grid-mobile {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .r-eiketsu-mobile {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem;
  }

  .r-eiketsu-img-mobile {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
  }

  .r-name-mobile {
    font-size: 0.6rem;
    /* Slightly smaller result name */
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
  }

  .r-cost-mobile {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.2);
    /* Changed from white to gray */
  }

  .r-cost-val {
    color: #fbbf24;
    /* Numbers stay gold */
  }

  .r-bonds-mobile {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .copyright-footer-mobile {
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.4;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }

  .m-load-confirmation {
    padding: 2rem 1.5rem;
    text-align: center;
    background: rgba(37, 99, 235, 0.05);
    border: 1px dashed var(--accent);
    border-radius: 16px;
    margin: 3rem 1rem;
  }

  .m-load-info {
    margin-bottom: 2rem;
  }

  .m-load-info p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
  }

  .btn-load-data {
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--accent-glow);
    transition: transform 0.2s;
  }

  .btn-load-data:active {
    transform: scale(0.98);
  }

  .main-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 120px;
    /* Space for the bottom bar */
  }

  /* File Selection UI */
  .m-file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .m-file-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
  }

  .m-file-card:active {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(0.98);
  }

  .m-file-card.cached {
    border-color: #2dd4bf;
    background: rgba(45, 212, 191, 0.05);
  }

  .m-file-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .m-file-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text);
  }

  .m-cache-badge {
    font-size: 0.65rem;
    background: #2dd4bf;
    color: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
    font-weight: bold;
  }

  .m-file-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }

  .m-file-meta span {
    font-size: 0.75rem;
    color: var(--text-sub);
  }

  .btn-load-small {
    background: var(--accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 60px;
  }

  .cached .btn-load-small {
    background: #2dd4bf;
  }

  .spinner-center {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
  }

  .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
}

/* Results Grid System */
.r-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 2.5rem !important;
  padding: 1rem 0;
}

@media (min-width: 1024px) {
  .r-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2.5rem !important;
    align-items: start;
    max-width: 1600px;
    margin: 0 auto;
  }
}

/* --- Modal Styles --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.85); /* 豺ｱ縺・レ譎ｯ濶ｲ */
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.modal-container {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 10;
}

.modal-header h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-sub);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.modal-body {
  padding: 2rem;
}

.modal-section {
  margin-bottom: 2rem;
}

.modal-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 0.75rem;
}

.modal-search-wrapper {
  position: relative;
}

.modal-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  color: var(--text);
  font-size: 0.95rem;
  transition: all 0.2s;
}

.modal-search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-sub);
}

.modal-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #1e293b;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
}

.modal-search-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s;
}

.modal-search-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.selected-item-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(59, 130, 246, 0.05);
  border: 1px dashed var(--accent);
  padding: 1rem;
  border-radius: 10px;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.01);
}

.upload-zone:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.03);
}

.upload-zone.has-file {
  border-style: solid;
  border-color: #2dd4bf;
  background: rgba(45, 212, 191, 0.02);
}

.preview-img {
  max-width: 100%;
  max-height: 250px;
  border-radius: 10px;
  margin-bottom: 1rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Success Screen styles */
.success-screen {
  text-align: center;
  padding: 1rem 0;
}

/* Standard Button Styles */
.btn-primary {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

.btn-primary:disabled {
  background: #1e293b;
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Help Icon & Tooltip */
.help-icon-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  cursor: help;
  color: var(--text-sub);
}

.help-icon {
  opacity: 0.6;
  transition: opacity 0.2s;
}

.help-icon-wrapper:hover .help-icon {
  opacity: 1;
  color: var(--accent);
}

.help-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #1e293b;
  color: #fff;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.7rem;
  width: 240px;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  z-index: 100;
  text-align: left;
  font-weight: normal;
}

.help-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
}

.help-icon-wrapper:hover .help-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-12px);
}

/* Bond Partition Groups */
.bond-part-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.part-btn {
  padding: 0.2rem 0.4rem !important;
  font-size: 0.7rem !important;
  min-width: 32px !important;
}

.part-btn.active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

/* Mobile Status & Bonds */
.r-stats-mobile {
  display: flex;
  gap: 12px;
  margin: 10px 0;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.r-stat-item-mobile {
  display: flex;
  flex-direction: column;
}

.r-stat-item-mobile .r-stat-label {
  font-size: 0.65rem;
  color: var(--text-sub);
  margin-bottom: 2px;
}

.r-stat-item-mobile .r-stat-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
}

.r-bonds-mobile {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.r-bond-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: rgba(244, 63, 94, 0.1);
  color: #fb7185;
  border-radius: 4px;
  border: 1px solid rgba(244, 63, 94, 0.2);
}
/* Update Button */
.btn-force-update {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.8rem;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border-radius: 8px;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  position: relative;
  overflow: hidden;
}
.btn-force-update:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4), 0 0 20px rgba(16, 185, 129, 0.2);
}
.update-badge {
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px #fff;
  animation: pulse-update 1.5s infinite;
}
@keyframes pulse-update {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}
.tab-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Init Error Recovery UI */
.init-error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
  background: var(--bg);
  color: var(--text-main);
}
.init-error-details {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  margin: 1.5rem 0;
  font-family: monospace;
  max-width: 80%;
  word-break: break-all;
}

/* Loading Overlay & Progress Bar */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 15, 26, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.loading-content {
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.spinner-large {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.loading-text {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.progress-container {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 0.3s ease;
}

.progress-label {
  font-family: 'Roboto Mono', monospace;
  font-weight: 800;
  color: var(--accent);
  font-size: 1.1rem;
}

/* Progress Bar Styles */
.progress-container {
  width: 100%;
  max-width: 300px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin: 1rem 0;
  overflow: hidden;
  position: relative;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.2s ease-out;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Download Progress Modal Styles */
.download-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}
.download-modal-content {
  background: #1e293b;
  padding: 2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.download-modal-title {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: #f8fafc;
  font-weight: 600;
}
.dl-progress-container {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.dl-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.3s ease;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}
.dl-progress-text {
  font-size: 0.9rem;
  color: #94a3b8;
}

/* Selective Sync Dot Indicator */
.not-loaded-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #fb7185;
  border-radius: 50%;
  margin-right: 4px;
  box-shadow: 0 0 5px rgba(251, 113, 133, 0.5);
}
.grade-btn.not-loaded {
  border-color: rgba(251, 113, 133, 0.3);
}


/* Not Cached Indicator */
.grade-btn.not-cached {
  position: relative;
}
.grade-btn.not-cached::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  background: #f87171;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(248, 113, 113, 0.5);
}
/* --- Modal Styles --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1.5rem;
}

.modal-content {
  background: var(--bg-panel);
  border: 1px solid var(--border-active);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(59, 130, 246, 0.2);
}

.modal-content.animate-pop {
  animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-pop {
  0% { opacity: 0; transform: scale(0.9) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-header {
  padding: 2rem 2rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.modal-icon {
  width: 48px;
  height: 48px;
  padding: 10px;
  border-radius: 50%;
}

.modal-icon.info { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.modal-icon.warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.modal-icon.danger { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.modal-body {
  padding: 0 2rem 2rem;
  text-align: center;
}

.modal-body p {
  margin: 0.5rem 0;
  color: var(--text-sub);
  line-height: 1.6;
}

.modal-footer {
  padding: 1.5rem 2rem;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-modal-cancel,
.btn-modal-confirm {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-modal-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-sub);
}

.btn-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
  color: #fff;
}

.btn-modal-confirm {
  border: none;
  min-width: 120px;
  justify-content: center;
}

.btn-modal-confirm.info { background: #3b82f6; color: #fff; }
.btn-modal-confirm.warning { background: #f59e0b; color: #fff; }
.btn-modal-confirm.danger { background: #ef4444; color: #fff; }

.btn-modal-confirm:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* --- Modal Loading Styles --- */
.modal-spinner-large {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(59, 130, 246, 0.1);
  border-left-color: #3b82f6;
  border-radius: 50%;
  animation: modal-spin 1s linear infinite;
}

.modal-spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-left-color: #fff;
  border-radius: 50%;
  animation: modal-spin 0.8s linear infinite;
}

@keyframes modal-spin {
  to { transform: rotate(360deg); }
}

.loading-sub {
  font-size: 0.8rem;
  color: var(--text-muted) !important;
  margin-top: 1rem !important;
  font-style: italic;
}
