/* ============================================================
   Global Reset & Base Variables
   ============================================================ */
:root {
  --bg-dark: #edf5fc;
  --bg-card: #ffffff;
  --bg-panel: #e4effb;
  --tier-row-bg: #cbd5e1;
  --tier-row-border: #94a3b8;
  --text-main: #0f172a;
  --text-muted: #475569;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent-red: #ef4444;
  --accent-gold: #eab308;
  --font-base: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-tier: 'Oswald', 'Noto Sans JP', Impact, sans-serif;
  --sticky-header-offset: 108px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-base);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   App Header & Control Bar
   ============================================================ */
.app-header {
  background: linear-gradient(135deg, #ffffff 0%, #eaf3ff 56%, #dfeeff 100%);
  border-bottom: 1px solid #bfd7f2;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 18px rgba(15, 55, 110, 0.08);
  backdrop-filter: blur(10px);
}

.app-header::before {
  content: "";
  display: block;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #38bdf8 0%, #6366f1 36%, #f43f5e 72%, #f59e0b 100%);
}

.header-container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 11px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  user-select: none;
  padding: 3px 8px 3px 4px;
  border-radius: 10px;
  transition: background-color 0.16s ease, transform 0.16s ease;
}

.header-brand:hover {
  background-color: rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.brand-emblem {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(145deg, #0f172a, #1e293b);
  border: 1.5px solid #38bdf8;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.brand-emblem::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(244, 63, 94, 0.08));
  pointer-events: none;
  z-index: 2;
}

.brand-emblem-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.brand-text-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.brand-badge {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.6px;
}

.brand-title {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.15;
  background: linear-gradient(95deg, #0f172a 0%, #1d4ed8 58%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 3px rgba(37, 99, 235, 0.16));
}

.brand-subtitle {
  font-size: 11.5px;
  font-weight: 700;
  color: #1e40af;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  padding: 2px 9px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Search & Filters */
.search-filter-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 165px;
  max-width: 220px;
  flex: 1 1 165px;
}

.search-box input {
  width: 100%;
  padding: 7px 28px 7px 12px;
  border-radius: 6px;
  border: 1px solid #b8d1eb;
  background-color: #ffffff;
  color: #0f172a;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input::placeholder {
  color: #64748b;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: none;
}

.search-box input:not(:placeholder-shown) + .clear-btn {
  display: block;
}

.filter-select {
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid #b8d1eb;
  background-color: #ffffff;
  color: #1e293b;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.filter-select.active-filter {
  border-color: #2563eb;
  background-color: #eff6ff;
  color: #1e3a8a;
}

.btn-filter-reset {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #b8d1eb;
  background-color: #ffffff;
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-filter-reset:hover {
  background-color: #dbeafe;
  border-color: #60a5fa;
  color: #1e3a8a;
}

/* Multi-Checkbox Filter Dropdowns */
.multi-filter-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.multi-dropdown {
  position: relative;
}

.multi-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #b8d1eb;
  background-color: #ffffff;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.multi-dropdown-btn:hover {
  border-color: #3b82f6;
  background-color: #f0f7ff;
  color: #0f172a;
}

.multi-dropdown-btn.active-filter {
  border-color: #1d4ed8;
  background-color: #2563eb;
  color: #ffffff;
}

.multi-dropdown-btn.is-open {
  border-color: #2563eb;
  background-color: #dbeafe;
  color: #1e3a8a;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.multi-dropdown-count {
  background-color: #1d4ed8;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 0 5px;
  border-radius: 10px;
  line-height: 1.4;
}

.multi-dropdown-btn.active-filter .multi-dropdown-count {
  background-color: #ffffff;
  color: #1d4ed8;
}

.multi-dropdown-arrow {
  font-size: 10px;
  opacity: 0.75;
}

.filter-overview-panel {
  flex: 0 0 100%;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  background-color: #f8fbff;
  border: 1px solid #bdd6f2;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 55, 110, 0.1);
}

.filter-overview-panel.is-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  flex: none;
  width: min(960px, calc(100vw - 28px));
  max-height: 75vh;
  overflow-y: auto;
  margin-top: 0;
  z-index: 450;
  border-width: 1.5px;
  box-shadow: 0 18px 42px rgba(15, 55, 110, 0.22);
}

@media (max-width: 768px) {
  .filter-overview-panel.is-popover {
    position: fixed;
    top: 64px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100vh - 84px);
    z-index: 1200;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.45);
  }
}

.filter-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid #d5e5f7;
  flex-wrap: wrap;
}

.filter-overview-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

.filter-overview-count {
  font-size: 11.5px;
  font-weight: 700;
  color: #1d4ed8;
  background-color: #dbeafe;
  border: 1px solid #93c5fd;
  padding: 1px 8px;
  border-radius: 999px;
}

.filter-overview-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-overview-clear-btn,
.filter-overview-close-btn {
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid #b8d1eb;
  background-color: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}

.filter-overview-clear-btn:hover,
.filter-overview-close-btn:hover {
  background-color: #eff6ff;
  color: #1d4ed8;
  border-color: #60a5fa;
}

.filter-overview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-overview-grid.is-multi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}

.filter-overview-grid.is-full-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-overview-grid.is-full-labels .filter-overview-option {
  flex: 0 1 auto;
  max-width: 100%;
}

.filter-overview-grid.is-full-labels .filter-overview-option-label {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.35;
}

.filter-overview-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #cde0f5;
  background-color: #ffffff;
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.12s, border-color 0.12s;
  min-width: 0;
}

.filter-overview-option:hover {
  background-color: #eff6ff;
  border-color: #60a5fa;
}

.filter-overview-option.is-checked {
  border-color: #2563eb;
  background-color: #dbeafe;
  color: #1e3a8a;
  font-weight: 600;
}

.filter-overview-option input[type="checkbox"] {
  accent-color: #2563eb;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  cursor: pointer;
}

.filter-overview-option-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-overview-empty {
  font-size: 12.5px;
  color: #64748b;
  padding: 4px 2px;
}

.filter-overview-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-overview-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed #cde0f5;
}

.filter-overview-group:first-child {
  padding-top: 0;
  border-top: none;
}

.filter-overview-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
  letter-spacing: 0.02em;
}

.filter-overview-group-count {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
}

.mode-badge.view-mode {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #38bdf8;
}

.mode-badge.admin-mode {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #ef4444;
  animation: pulse-glow 2s infinite;
}

.mode-badge.editor-mode {
  background-color: #dcfce7;
  color: #047857;
  border: 1px solid #10b981;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 4px rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.55); }
}

.admin-actions-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Buttons */
.btn {
  padding: 7px 15px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: #e2ecf7;
  color: #1e293b;
  border: 1px solid #c3d7ec;
}
.btn-secondary:hover {
  background-color: #d0e2f5;
}

.btn-outline {
  background-color: #ffffff;
  color: #1e3a5f;
  border: 1px solid #93c5fd;
}
.btn-outline:hover {
  background-color: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.btn-auth {
  background-color: #ffffff;
  color: #1e3a5f;
  border: 1px solid #b8d1eb;
}
.btn-auth:hover {
  background-color: #eff6ff;
  border-color: #60a5fa;
  color: #1d4ed8;
}

.btn-danger {
  background-color: #dc2626;
  color: #fff;
}
.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-danger-outline {
  background-color: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
}
.btn-danger-outline:hover {
  background-color: #ef4444;
  color: #fff;
}

.hidden {
  display: none !important;
}

/* ============================================================
   Main Tier Board Layout (Matching Image 1 & 2)
   ============================================================ */
.tier-board-wrapper {
  flex: 1;
  padding: 24px 16px 40px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
  max-width: 1720px;
  width: 100%;
  margin: 0 auto;
}

.tier-board-container {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 1460px;
  background-color: #ffffff;
  border: 1px solid #c5dcf3;
  box-shadow: 0 8px 28px rgba(15, 55, 110, 0.14);
  border-radius: 6px;
  overflow: hidden;
}

.tier-video-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 14px;
  background: linear-gradient(90deg, #e5f0ff, #f2f8ff);
  border-bottom: 1.5px solid #bdd6f2;
  color: #1e293b;
}

.tier-video-mode-bar.is-active {
  background: linear-gradient(90deg, #d1fae5, #ecfdf5);
  border-bottom-color: #10b981;
  color: #065f46;
}

.tier-nohist-mode-bar {
  background: linear-gradient(90deg, #edf4fc, #f5f9ff);
  border-bottom: 1.5px solid #c5dcf3;
}

.tier-nohist-mode-bar.is-active {
  background: linear-gradient(90deg, #fef3c7, #fffbeb);
  border-bottom-color: #f59e0b;
  color: #78350f;
}

.tier-nohist-mode-btn.is-active {
  background-color: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.tier-video-mode-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.tier-video-mode-info strong {
  color: #0f172a;
  margin-right: 6px;
}

.tier-video-mode-sub {
  color: #475569;
  font-size: 12px;
}

.tier-video-mode-icon {
  font-size: 18px;
}

.tier-video-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #93c5fd;
  background-color: #ffffff;
  color: #1e3a5f;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tier-video-mode-btn:hover {
  border-color: #2563eb;
  background-color: #eff6ff;
  color: #1d4ed8;
}

.tier-video-mode-btn.is-active {
  background-color: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

.tier-video-mode-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #94a3b8;
}

.tier-video-mode-btn.is-active .tier-video-mode-dot {
  background-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.28);
}

/* ============================================================
   Right Sidebar Column (Author SNS + Edit History)
   ============================================================ */
.right-sidebar-col {
  width: 310px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 74px;
}

.author-card {
  background-color: #ffffff;
  border: 1px solid #c5dcf3;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(15, 55, 110, 0.08);
  overflow: hidden;
}

.author-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background-color: #eef5fe;
  border-bottom: 1px solid #cde0f5;
}

.author-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.author-title-group h3 {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.author-links-list {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sns-link-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: transform 0.15s ease, filter 0.15s ease, background-color 0.15s ease;
  border: 1px solid transparent;
}

.sns-link-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

.sns-link-btn.youtube {
  background-color: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.sns-link-btn.youtube .sns-icon-svg {
  color: #dc2626;
  flex-shrink: 0;
}

.sns-link-btn.x-twitter {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.sns-link-btn.x-twitter .sns-icon-svg {
  color: #0f172a;
  flex-shrink: 0;
}

.sns-link-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sns-ext-arrow {
  font-size: 12px;
  opacity: 0.7;
}

.author-empty-hint {
  font-size: 12.5px;
  color: #64748b;
  text-align: center;
  padding: 6px 4px;
  cursor: pointer;
}

.author-empty-hint:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.history-sidebar {
  width: 100%;
  background-color: #ffffff;
  border: 1px solid #c5dcf3;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(15, 55, 110, 0.08);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 230px);
  overflow: hidden;
}

@media (max-width: 1120px) {
  .tier-board-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
  .right-sidebar-col {
    width: 100%;
    position: static;
  }
  .history-sidebar {
    max-height: 400px;
  }
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background-color: #eef5fe;
  border-bottom: 1px solid #cde0f5;
}

.history-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-title-group h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.3px;
}

.history-admin-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-mini-btn {
  background-color: #ffffff;
  color: #334155;
  border: 1px solid #bfd7f2;
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.history-mini-btn:hover {
  background-color: #dbeafe;
  color: #1e3a8a;
}

.history-mini-btn.danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-list::-webkit-scrollbar {
  width: 6px;
}
.history-list::-webkit-scrollbar-thumb {
  background-color: #bfd7f2;
  border-radius: 3px;
}

.history-empty {
  text-align: center;
  color: #64748b;
  font-size: 12px;
  padding: 24px 10px;
}

.history-item {
  background-color: #f7fbff;
  border: 1px solid #d4e4f7;
  border-radius: 6px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  transition: border-color 0.15s, background-color 0.15s;
}

.history-item.clickable {
  cursor: pointer;
}

.history-item.clickable:hover {
  border-color: #3b82f6;
  background-color: #edf5ff;
}

.history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.history-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  color: #fff;
}

.history-type-badge.type-tier { background-color: #2563eb; }
.history-type-badge.type-add { background-color: #059669; }
.history-type-badge.type-edit { background-color: #d97706; }
.history-type-badge.type-delete { background-color: #dc2626; }
.history-type-badge.type-system { background-color: #6366f1; }
.history-type-badge.type-memo { background-color: #64748b; }

.history-time {
  font-size: 11.5px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.history-target {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-detail {
  font-size: 13px;
  color: #334155;
  line-height: 1.45;
}

.history-del-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: none;
}

.admin-mode-active .history-item:hover .history-del-btn {
  display: block;
}

.history-del-btn:hover {
  color: #ef4444;
}

/* Image 1 Header Replica */
.tier-board-header {
  background-color: #ffffff;
  color: #000000;
  padding: 12px 18px 8px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  border-bottom: 2px solid #000000;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.tbh-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.tbh-logo-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tbh-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.tbh-logo-icon {
  font-size: 28px;
  line-height: 1;
}

.tbh-game-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #111;
}

.tbh-main-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #000;
}

.tbh-date {
  font-size: 25px;
  font-weight: 600;
  color: #000;
  letter-spacing: 0.5px;
}

.tbh-right {
  margin-left: 0;
  align-self: center;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.tbh-condition {
  font-size: 14.5px;
  font-weight: 600;
  color: #000;
}

.tbh-criteria {
  font-size: 14.5px;
  font-weight: 600;
  color: #000;
}

/* Tier Rows List */
.tier-rows-container {
  display: flex;
  flex-direction: column;
  background-color: #71717a;
}

.tier-row {
  display: flex;
  min-height: 68px;
  border-bottom: 1px solid #3f3f46;
  position: relative;
  background-color: #9499a0;
  transition: background-color 0.2s;
}

.tier-row.drag-over {
  background-color: #78716c;
  outline: 2px dashed #f59e0b;
}

/* Left Tier Label (X, SSS, SS, etc.) */
.tier-label-box {
  position: relative;
  width: 66px;
  min-width: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-tier);
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  user-select: none;
  box-shadow: 2px 0 6px rgba(0,0,0,0.25);
  z-index: 2;
  text-shadow: none;
}

.tier-label-box.has-tier-desc {
  cursor: help;
}

.tier-label-box.has-tier-desc:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.tier-desc-badge {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background-color: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  font-family: var(--font-base);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.65);
  pointer-events: none;
}

.is-capturing-png .tier-desc-badge {
  display: none !important;
}

.tier-label-tooltip {
  position: fixed;
  z-index: 2200;
  width: max-content;
  max-width: min(340px, calc(100vw - 24px));
  background: linear-gradient(135deg, #ffffff, #f2f8ff);
  color: #0f172a;
  border: 1.5px solid #93c5fd;
  border-radius: 10px;
  padding: 10px 13px;
  box-shadow: 0 12px 28px rgba(15, 55, 110, 0.22);
  pointer-events: none;
}

.tier-tip-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid #d6e6f7;
}

.tier-tip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-tier);
  font-size: 13px;
  font-weight: 800;
  border: 1px solid rgba(0, 0, 0, 0.22);
}

.tier-tip-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #1e3a8a;
}

.tier-tip-body {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  color: #1e293b;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Right Content Area: Character Icons Grid */
.tier-items-box {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  padding: 3px 6px;
  gap: 4px;
  min-height: 68px;
}

/* Tier Row Actions (Visible in Admin Mode) */
.tier-row-admin-tools {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  gap: 4px;
  background-color: rgba(15, 23, 42, 0.9);
  padding: 4px 8px;
  border-radius: 6px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.admin-mode-active .tier-row:hover .tier-row-admin-tools,
.editor-mode-active .tier-row:hover .tier-row-admin-tools {
  display: flex;
}

.tier-tool-btn {
  background: none;
  border: none;
  color: #e2e8f0;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 4px;
  transition: background 0.15s;
}

.tier-tool-btn:hover {
  background-color: #334155;
  color: #fff;
}

/* ============================================================
   Character Cards (Image 2 Replica)
   ============================================================ */
.char-card {
  width: 58px;
  height: 58px;
  position: relative;
  background-color: #27272a;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  flex-shrink: 0;
  border: none;
}

.char-card:hover {
  transform: scale(1.08);
  z-index: 20;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.char-card.dragging {
  opacity: 0.35;
  transform: scale(0.95);
}

.admin-mode-active .char-card {
  cursor: grab;
}

.admin-mode-active .char-card:active {
  cursor: grabbing;
}

.char-card.drop-target-before {
  box-shadow: -3px 0 0 0 #38bdf8, -5px 0 10px rgba(56, 189, 248, 0.85);
  z-index: 25;
}

.char-card.drop-target-after {
  box-shadow: 3px 0 0 0 #38bdf8, 5px 0 10px rgba(56, 189, 248, 0.85);
  z-index: 25;
}

/* Character Image */
.char-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.char-card-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #374151, #1f2937);
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 2px;
  word-break: break-all;
}

/* Type / Class icon on top-left */
.char-card-class-badge {
  position: absolute;
  top: 1px;
  left: 1px;
  background-color: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 9px;
  padding: 1px 3px;
  border-radius: 2px;
  line-height: 1.1;
  font-weight: 700;
  backdrop-filter: blur(2px);
  pointer-events: none;
}

/* Special Badges (限定 / アニバ限定) on top-right or top bar */
.char-card-badge {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 8px;
  font-weight: 900;
  padding: 1px 3px;
  line-height: 1.1;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.char-card-badge.badge-red {
  background-color: #dc2626;
  color: #fff;
}

.char-card-badge.badge-yellow,
.char-card-badge.badge-gold {
  background-color: #18181b;
  border-bottom: 1px solid #facc15;
  border-left: 1px solid #facc15;
}

.rainbow-badge-text {
  background: linear-gradient(90deg, #ff4d4d, #ff9900, #ffee00, #33ff33, #33ccff, #cc66ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
  display: inline-block;
}

.is-capturing-png .rainbow-badge-text {
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  -webkit-text-fill-color: #fde047 !important;
  color: #fde047 !important;
}

.char-card-badge.badge-blue {
  background-color: #2563eb;
  color: #fff;
}

.char-card-badge.badge-purple {
  background-color: #9333ea;
  color: #fff;
}

.char-card-badge.badge-green {
  background-color: #16a34a;
  color: #fff;
}

/* Border highlighting based on badge (No border by default, red for 限定, yellow for アニバ限定) */
.char-card.has-badge-red {
  border: 2px solid #ef4444;
}

.char-card.has-badge-yellow,
.char-card.has-badge-gold {
  border: 2px solid #facc15;
}

/* Character Card Admin Controls */
.char-card-admin-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(0,0,0,0.8);
  color: #cbd5e1;
  font-size: 10px;
  padding: 1px 4px;
  display: none;
}

.admin-mode-active .char-card:hover .char-card-admin-btn,
.editor-mode-active .char-card:hover .char-card-admin-btn {
  display: block;
}

/* Unassigned Characters Pool */
.unassigned-pool {
  background-color: #eef5fd;
  border-top: 2px solid #bfd7f2;
  padding: 16px;
}

.unassigned-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.unassigned-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.unassigned-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.unassigned-hint {
  font-size: 13px;
  color: #475569;
}

.unassigned-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 64px;
  background-color: #ffffff;
  padding: 10px;
  border-radius: 6px;
  border: 1.5px dashed #93c5fd;
}

/* ============================================================
   Batch Import Modal Styles
   ============================================================ */
.batch-import-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.batch-drop-zone {
  border: 2px dashed #94a3b8;
  border-radius: 8px;
  padding: 28px 20px;
  text-align: center;
  background-color: #f8fafc;
  transition: all 0.2s ease;
  cursor: pointer;
}

.batch-drop-zone.dragover {
  border-color: #059669;
  background-color: #ecfdf5;
}

.drop-icon {
  font-size: 38px;
  margin-bottom: 6px;
}

.drop-text {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}

.drop-subtext {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 14px;
}

.drop-btn-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.batch-options-card {
  background-color: #f1f5f9;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input {
  cursor: pointer;
}

.batch-progress-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #059669, #10b981);
  transition: width 0.1s linear;
}

.batch-status-text {
  font-size: 12px;
  font-weight: 600;
  color: #059669;
  text-align: center;
}

.batch-preview-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
  background-color: #fafafa;
}

.batch-preview-header h4 {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.batch-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.batch-mode-tabs {
  display: flex;
  gap: 8px;
}

.batch-mode-tab {
  flex: 1;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background-color: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.batch-mode-tab:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.batch-mode-tab.active {
  background-color: #059669;
  border-color: #059669;
  color: #ffffff;
}

.batch-unmatched-box {
  font-size: 12px;
  line-height: 1.5;
  color: #92400e;
  background-color: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 8px 12px;
  max-height: 90px;
  overflow-y: auto;
}

.batch-preview-item {
  width: 44px;
  height: 44px;
  position: relative;
  border: 1px solid #cbd5e1;
  border-radius: 2px;
  overflow: hidden;
  background-color: #fff;
}

.batch-preview-item.wide-awakened {
  width: 96px;
  height: 54px;
  border-radius: 4px;
}

.batch-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   Character Detail Modal (Image 3 Replica)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

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

.modal-dialog {
  background-color: #ffffff;
  color: #111827;
  border-radius: 6px;
  position: relative;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.small-modal-dialog {
  width: 100%;
  max-width: 440px;
  padding: 24px;
}

.medium-modal-dialog {
  width: 100%;
  max-width: 600px;
  padding: 24px;
}

.large-modal-dialog {
  width: 100%;
  max-width: 860px;
  padding: 24px;
}

.char-form-modal-dialog {
  padding: 0 !important;
}

.char-form-sticky-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-radius: 6px 6px 0 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.char-form-sticky-header h3 {
  font-size: 19px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.char-form-sticky-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.char-form-close-inline {
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.char-form-close-inline:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.char-form-scroll-body {
  padding: 18px 24px 24px;
}

@media (max-width: 768px) {
  .char-form-sticky-header {
    padding: 10px 14px;
  }
  .char-form-sticky-header h3 {
    font-size: 16px;
  }
  .char-form-scroll-body {
    padding: 14px 14px 20px;
  }
}

.detail-modal-dialog {
  width: 100%;
  max-width: 980px;
  padding: 48px 28px 24px;
  background-color: #ffffff;
}

.char-detail-modal-dialog {
  max-width: min(1720px, 97vw);
}

.detail-sticky-close-bar {
  position: sticky;
  top: 8px;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
  height: 0;
  overflow: visible;
  pointer-events: none;
  margin-top: -36px;
  margin-bottom: 36px;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s;
}

.modal-close-btn:hover {
  color: #0f172a;
}

.detail-sticky-close-btn {
  position: static;
  pointer-events: auto;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background-color: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.35);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  backdrop-filter: blur(4px);
  transition: background-color 0.15s, transform 0.15s;
}

.detail-sticky-close-btn:hover {
  background-color: #dc2626;
  color: #ffffff;
  transform: translateY(-1px);
}

.modal-header {
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 22px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0.2px;
}

.modal-subtitle {
  font-size: 14px;
  color: #64748b;
  margin-top: 4px;
}

.modal-footer {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* --- Detail View Layout (Image 3) --- */
.detail-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 24px;
  align-items: start;
}

.detail-layout-grid > *,
.detail-top-split > *,
.detail-profile-box,
.detail-matrices-box {
  min-width: 0;
  max-width: 100%;
}

.detail-main-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.detail-rec-sidebar {
  position: sticky;
  top: 0;
  min-width: 0;
}

.detail-top-split {
  display: grid;
  grid-template-columns: minmax(340px, 1.05fr) 1.35fr;
  gap: 24px;
}

@media (max-width: 1260px) {
  .detail-layout-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
  }
  .detail-top-split {
    grid-template-columns: minmax(270px, 0.95fr) 1.25fr;
    gap: 18px;
  }
}

@media (max-width: 1139px) {
  .detail-layout-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .detail-rec-sidebar {
    position: static;
  }
  .char-detail-modal-dialog {
    padding: 44px 18px 20px;
  }
  .detail-top-split {
    grid-template-columns: minmax(250px, 0.92fr) 1.28fr;
    gap: 16px;
  }
}

@media (max-width: 960px) {
  .detail-top-split {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .detail-avatar-wrap {
    width: 92px;
    height: 92px;
  }
  .detail-char-name {
    font-size: 21px;
  }
}

/* Detail Top-Left Profile */
.detail-profile-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-avatar-name-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.detail-avatar-wrap {
  width: 110px;
  height: 110px;
  position: relative;
  border: none;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  background-color: #27272a;
}

.detail-avatar-wrap.has-badge-red {
  border: 2.5px solid #ef4444;
}

.detail-avatar-wrap.has-badge-yellow,
.detail-avatar-wrap.has-badge-gold {
  border: 2.5px solid #facc15;
}

.detail-avatar-badge {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 5px;
  line-height: 1.15;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.detail-avatar-badge.badge-red {
  background-color: #dc2626;
  color: #fff;
}

.detail-avatar-badge.badge-yellow,
.detail-avatar-badge.badge-gold {
  background-color: #18181b;
  border-bottom: 1.5px solid #facc15;
  border-left: 1.5px solid #facc15;
}

.detail-avatar-badge.badge-blue {
  background-color: #2563eb;
  color: #fff;
}

.detail-avatar-badge.badge-purple {
  background-color: #9333ea;
  color: #fff;
}

.detail-avatar-badge.badge-green {
  background-color: #16a34a;
  color: #fff;
}

.detail-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}

.detail-avatar-class-tag {
  position: absolute;
  top: 2px;
  left: 2px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 2px;
  font-weight: 800;
}

.detail-name-tier-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
}

.detail-char-name {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  letter-spacing: 0.2px;
}

.detail-tier-transition {
  font-size: 19px;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-current-tier-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 4px 16px;
  border-radius: 6px;
  font-family: var(--font-tier);
  font-size: 22px;
  font-weight: 700;
  border: 1.5px solid rgba(0, 0, 0, 0.22);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* Gacha Type & Lumina Badges below Tier */
.detail-sub-badges-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.detail-rarity-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  line-height: 1.25;
}

.detail-rarity-type-badge.type-regular {
  background-color: #475569;
  color: #ffffff;
}

.detail-rarity-type-badge.type-limited {
  background-color: #dc2626;
  color: #ffffff;
}

.detail-rarity-type-badge.type-anniv {
  background-color: #18181b;
  border: 1.5px solid #facc15;
}

.detail-lumina-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  line-height: 1.25;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  border: 1px solid #bae6fd;
  box-shadow: 0 1px 4px rgba(14, 165, 233, 0.35);
}

/* Awakened Illustration Header Banner in Detail Profile Box */
.detail-awakened-box {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
  background-color: #f1f5f9;
  position: relative;
  margin-top: 2px;
}

.detail-awakened-img {
  width: 100%;
  height: auto;
  min-height: 185px;
  max-height: 300px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.25s ease;
}

.detail-awakened-img:hover {
  transform: scale(1.02);
}

.detail-awakened-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 12px 8px 4px;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
}

.detail-awakened-empty {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  border: 1px dashed #cbd5e1;
  background-color: #f8fafc;
}

/* Fullscreen Lightbox for Awakened Illustration */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.88);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}

.lightbox-img {
  max-width: 95vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

/* Detail Top-Right Matrices */
.detail-matrices-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

.matrix-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13.5px;
  font-weight: 600;
  color: #000;
  margin-bottom: 5px;
}

.matrix-subtitle {
  font-size: 12px;
  color: #4b5563;
  font-weight: 400;
}

/* Seal Battle Table (Matrix 1) */
.seal-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border: 1px solid #000;
  text-align: center;
}

.seal-matrix-table th,
.seal-matrix-table td {
  border: 1px solid #000;
  padding: 6px 4px;
}

.seal-matrix-table th {
  background-color: #f8fafc;
  color: #000;
  font-weight: 600;
  font-size: 12.5px;
}

.seal-matrix-table th.cat-header,
.seal-matrix-table td.cat-header {
  font-weight: 700;
}
.seal-matrix-table .cat-header.cat-bomb { color: #dc2626; }
.seal-matrix-table .cat-header.cat-destroy { color: #16a34a; }
.seal-matrix-table .cat-header.cat-shock { color: #2563eb; }
.seal-matrix-table tbody th.seal-boss-header {
  font-weight: 700;
  font-size: 12.5px;
  white-space: nowrap;
  padding: 6px 8px;
}

.symbol-cross,
.symbol-triangle,
.symbol-circle,
.symbol-double-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  font-weight: 900;
  font-size: 15px;
  line-height: 1;
  vertical-align: middle;
}

.symbol-cross {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
  font-size: 14px;
}

.symbol-triangle {
  background-color: #dbeafe;
  border: 1.5px solid #60a5fa;
  color: #1d4ed8;
  font-size: 14px;
}

.symbol-circle {
  background-color: #dcfce7;
  border: 1.5px solid #4ade80;
  color: #15803d;
  font-size: 16px;
}

.symbol-double-circle {
  background-color: #fee2e2;
  border: 1.5px solid #f87171;
  color: #b91c1c;
  font-size: 16px;
  box-shadow: 0 1px 4px rgba(220, 38, 38, 0.16);
}

/* Conquest Battle Table (Matrix 2) */
.conquest-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  border: 1px solid #000;
  text-align: center;
}

.conquest-matrix-table th,
.conquest-matrix-table td {
  border: 1px solid #000;
  padding: 6px 5px;
}

.conquest-matrix-table th {
  font-weight: 700;
  font-size: 13px;
  width: 62%;
  padding: 6px 10px;
}

.conquest-matrix-table td {
  font-size: 15px;
  width: 38%;
}

/* Aptitude Cell Criteria Hover/Focus Tooltip */
.aptitude-cell {
  cursor: help;
  outline: none;
  transition: background-color 0.12s ease;
}

.aptitude-cell:hover,
.aptitude-cell:focus {
  background-color: #fef9c3;
}

.aptitude-tip-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
}

.aptitude-tip-anchor[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: min(270px, 72vw);
  padding: 8px 11px;
  border-radius: 7px;
  background-color: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
  z-index: 60;
}

.aptitude-tip-anchor[data-tooltip]::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
  z-index: 61;
}

.aptitude-tip-anchor.tooltip-align-right[data-tooltip]::after {
  left: auto;
  right: -10px;
  transform: translateY(4px);
}

.aptitude-tip-anchor.tooltip-align-left[data-tooltip]::after {
  left: -10px;
  right: auto;
  transform: translateY(4px);
}

.aptitude-cell:hover .aptitude-tip-anchor::after,
.aptitude-cell:hover .aptitude-tip-anchor::before,
.aptitude-cell:focus .aptitude-tip-anchor::after,
.aptitude-cell:focus .aptitude-tip-anchor::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.aptitude-cell:hover .aptitude-tip-anchor.tooltip-align-right::after,
.aptitude-cell:focus .aptitude-tip-anchor.tooltip-align-right::after,
.aptitude-cell:hover .aptitude-tip-anchor.tooltip-align-left::after,
.aptitude-cell:focus .aptitude-tip-anchor.tooltip-align-left::after {
  transform: translateY(0);
}

/* Detail Bottom Evaluation Reasons Box (Matching Image 3) */
.detail-evaluation-box {
  border: 1px solid #000;
  padding: 16px 20px;
  background-color: #ffffff;
  color: #000000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
  line-height: 1.65;
}

.evaluation-header {
  font-size: 16.5px;
  font-weight: 700;
  color: #000000;
  letter-spacing: 0.3px;
}

.skill-effect-line {
  font-weight: 500;
}

.skill-effect-line strong {
  font-weight: 800;
}

.reasons-list {
  list-style-type: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reasons-list li {
  position: relative;
  padding-left: 18px;
  font-weight: 500;
}

.reasons-list li::before {
  content: "●";
  position: absolute;
  left: 0;
  font-size: 9px;
  top: 4px;
  color: #000;
}

/* ============================================================
   Detail Performance Section (Below Evaluation Reasons)
   ============================================================ */
.detail-performance-box {
  border: 1px solid #000;
  padding: 16px 18px;
  background-color: #f8fafc;
  color: #000;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.performance-section-header {
  font-size: 17px;
  font-weight: 700;
  color: #000;
  border-bottom: 2px solid #000;
  padding-bottom: 5px;
  letter-spacing: 0.3px;
}

.perf-sub-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.perf-sub-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.perf-meta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background-color: #fff;
}

.perf-meta-table th,
.perf-meta-table td {
  border: 1px solid #475569;
  padding: 7px 9px;
  text-align: center;
}

.perf-meta-table th {
  background-color: #e2e8f0;
  font-weight: 600;
  color: #0f172a;
  font-size: 13px;
}

.perf-meta-table td {
  font-weight: 500;
  color: #000;
}

.perf-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #475569;
  border-left: 1px solid #475569;
  background-color: #fff;
}

@media (max-width: 640px) {
  .perf-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.perf-stat-cell {
  border-right: 1px solid #475569;
  border-bottom: 1px solid #475569;
  padding: 8px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.perf-stat-label {
  font-weight: 600;
  color: #475569;
  font-size: 12.5px;
}

.perf-stat-value {
  font-weight: 700;
  color: #000;
}

.perf-ability-card {
  border: 1px solid #475569;
  background-color: #fff;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.perf-ability-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 4px;
}

.perf-ability-name {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.perf-ability-badge {
  background-color: #1e293b;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 4px;
}

.perf-ability-badge.blade-badge {
  background-color: #b91c1c;
}

.perf-ability-desc {
  font-size: 14.5px;
  line-height: 1.6;
  color: #1e293b;
  white-space: pre-wrap;
}

.perf-trait-unlock {
  margin-top: 5px;
  padding: 8px 12px;
  background-color: #fefce8;
  border-left: 3px solid #eab308;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.perf-trait-unlock.star5 {
  background-color: #fef2f2;
  border-left-color: #ef4444;
}

.perf-trait-unlock strong {
  font-weight: 700;
  margin-right: 6px;
}

.trait-unlock-editor-box {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 12px;
}

.trait-unlock-toggle {
  font-size: 13px;
  color: #0f172a;
}

.trait-large-textarea {
  width: 100%;
  min-height: 115px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.55;
  resize: vertical;
  background-color: #fff;
  color: #1e293b;
}

.trait-large-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.char-awakened-preview-box {
  width: 100%;
  height: 90px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8fafc;
  overflow: hidden;
}

.char-awakened-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   Forms & Modals Styles
   ============================================================ */
.form-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.form-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 12px;
  letter-spacing: 0.2px;
}

.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.form-group.col-8 { flex: 0 0 calc(66.666% - 6px); }
.form-group.col-7 { flex: 0 0 calc(58.333% - 6px); }
.form-group.col-6 { flex: 0 0 calc(50% - 6px); }
.form-group.col-5 { flex: 0 0 calc(41.666% - 6px); }
.form-group.col-4 { flex: 0 0 calc(33.333% - 8px); }
.form-group.col-3 { flex: 0 0 calc(25% - 9px); }
.form-group.col-2 { flex: 0 0 calc(16.666% - 10px); }

@media (max-width: 640px) {
  .form-group.col-8,
  .form-group.col-7,
  .form-group.col-6,
  .form-group.col-5,
  .form-group.col-4,
  .form-group.col-3,
  .form-group.col-2 {
    flex: 1 1 100%;
  }
}

.form-group label {
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
  padding: 8px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  background-color: #fff;
  color: #1e293b;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.form-hint {
  font-size: 12.5px;
  color: #64748b;
  margin-bottom: 8px;
}

.req {
  color: #ef4444;
}

.form-error {
  font-size: 12px;
  color: #dc2626;
  margin-top: 4px;
}

.form-success {
  font-size: 12px;
  color: #16a34a;
  margin-top: 4px;
}

.char-preview-card {
  width: 58px;
  height: 58px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8fafc;
  overflow: hidden;
}

.char-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-placeholder {
  font-size: 10px;
  color: #94a3b8;
}

/* Matrix Table Editor */
.matrix-table-editor-wrapper {
  overflow-x: auto;
}

.matrix-edit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.matrix-edit-table th,
.matrix-edit-table td {
  border: 1px solid #cbd5e1;
  padding: 6px;
  text-align: center;
}

.matrix-edit-table th {
  background-color: #f1f5f9;
  font-weight: 600;
}

.matrix-edit-table input[type="text"],
.matrix-edit-table select {
  width: 60px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  padding: 4px;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background-color: #fff;
  color: #0f172a;
  cursor: pointer;
}

/* Data Management Modal */
.data-manage-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.manage-box {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background-color: #f8fafc;
}

.manage-box h4 {
  font-size: 15.5px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}

.manage-box p {
  font-size: 13.5px;
  color: #64748b;
  margin-bottom: 10px;
}

.manage-box.danger-box {
  border-color: #fca5a5;
  background-color: #fff1f2;
}

.inline-form {
  display: flex;
  gap: 8px;
}

.inline-form input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13px;
}

.file-label {
  cursor: pointer;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #0f172a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  z-index: 2000;
  animation: slideUp 0.25s ease-out;
  border-left: 4px solid var(--primary);
}

/* ============================================================
   Permission Lock & Editor Permissions Settings Styles
   ============================================================ */
.form-section.perm-locked {
  opacity: 0.55;
  background-color: #f8fafc;
  padding: 12px;
  border-radius: 6px;
  position: relative;
}

.form-group.perm-locked-field {
  opacity: 0.55;
}

.perm-locked-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  background-color: #e2e8f0;
  color: #475569;
  padding: 2px 7px;
  border-radius: 4px;
}

.editor-perms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 600px) {
  .editor-perms-grid {
    grid-template-columns: 1fr;
  }
}

.perm-check-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background-color: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.perm-check-card:hover {
  border-color: #3b82f6;
  background-color: #eff6ff;
}

.perm-check-card input[type="checkbox"] {
  margin-top: 3px;
  accent-color: #2563eb;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.perm-check-card div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.perm-check-card strong {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.perm-check-card span {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.35;
}

/* ============================================================
   Character Text Auto-Import Card
   ============================================================ */
.text-import-card {
  border: 1px solid #bfdbfe;
  background-color: #eff6ff;
  border-radius: 8px;
  margin-bottom: 18px;
  overflow: hidden;
}

.text-import-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  background-color: #dbeafe;
  gap: 10px;
}

.text-import-header:hover {
  background-color: #bfdbfe;
}

.text-import-toggle-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  gap: 2px;
}

.text-import-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e3a8a;
}

.text-import-sub {
  font-size: 11.5px;
  color: #3b82f6;
}

.text-import-chevron {
  font-size: 12px;
  color: #1e40af;
  font-weight: 700;
  user-select: none;
}

.text-import-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.text-import-body.hidden {
  display: none;
}

.text-import-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.text-import-toolbar-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#char-text-import-input {
  width: 100%;
  background-color: #ffffff;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.45;
  resize: vertical;
  font-family: inherit;
}

.text-import-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.text-import-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 5px;
  line-height: 1.4;
}

.text-import-status.success {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.text-import-status.warning {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

/* ============================================================
   Inline Element & Role Icons + Page Tabs + Character List Page
   ============================================================ */
.attr-inline-icon,
.role-inline-icon {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 3px;
}

.role-inline-icon {
  background-color: #ffffff;
  padding: 1px;
  border: 1px solid #cbd5e1;
}

.meta-icon-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.page-tabs-bar {
  background: #e6f0fc;
  border-top: 1px solid #c5dcf3;
}

.page-tabs-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 7px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid #bfd7f2;
  background-color: #ffffff;
  color: #1e3a5f;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.page-tab-btn:hover {
  background-color: #dbeafe;
  border-color: #60a5fa;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.page-tab-btn.active {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.char-list-wrapper {
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.char-list-container {
  background-color: #ffffff;
  border: 1px solid #c5dcf3;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 55, 110, 0.08);
}

.char-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid #d6e6f7;
}

.char-list-filter-bar {
  position: sticky;
  top: var(--sticky-header-offset, 108px);
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background-color: #f2f7fe;
  border: 1px solid #cde0f5;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(15, 55, 110, 0.1);
  margin-bottom: 16px;
}

html[data-theme="dark"] .char-list-filter-bar {
  box-shadow: 0 4px 16px rgba(2, 6, 23, 0.45);
}

.filter-bar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 240px;
}

.char-list-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.char-list-heading {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.char-list-count {
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
  background-color: #dbeafe;
  border: 1px solid #93c5fd;
  padding: 3px 10px;
  border-radius: 999px;
}

.char-list-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.char-list-sort-stack {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-left: auto;
}

.char-list-sort-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.char-list-sort-group.is-secondary .char-list-control-label {
  font-size: 12px;
  color: #475569;
}

.char-list-sort-group.is-secondary .char-list-select,
.char-list-sort-group.is-secondary .char-list-dir-btn {
  font-size: 12.5px;
  padding: 5px 9px;
  border-color: #c5dcf3;
  background-color: #f8fbff;
  color: #1e293b;
}

.char-list-control-label {
  font-size: 13px;
  color: #334155;
  font-weight: 600;
  white-space: nowrap;
}

.char-list-select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #b8d1eb;
  background-color: #ffffff;
  color: #0f172a;
  font-size: 13.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.char-list-dir-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #b8d1eb;
  background-color: #ffffff;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.char-list-dir-btn:hover {
  background-color: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

@media (min-width: 1024px) {
  .char-list-filter-bar {
    flex-wrap: nowrap;
    gap: 10px;
  }
  .filter-bar-left {
    flex-wrap: nowrap;
    min-width: 0;
    gap: 6px;
  }
  .char-list-filter-bar .search-box {
    flex: 1 1 120px;
    min-width: 110px;
    max-width: 185px;
  }
  .char-list-filter-bar .multi-filter-wrapper {
    flex-wrap: nowrap;
    flex-shrink: 0;
  }
  .char-list-filter-bar .btn-filter-reset {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .char-list-sort-stack {
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 8px;
  }
  .char-list-sort-group {
    gap: 5px;
    flex-shrink: 0;
  }
  .char-list-select {
    max-width: 145px;
    padding: 6px 8px;
    font-size: 13px;
  }
  .char-list-sort-group.is-secondary .char-list-select {
    max-width: 112px;
  }
  .char-list-dir-btn {
    padding: 6px 9px;
    font-size: 12.5px;
  }
}

.char-list-view-toggle {
  display: inline-flex;
  background-color: #e8f1fc;
  border: 1px solid #bfd7f2;
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}

.view-mode-btn {
  padding: 5px 11px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #475569;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.view-mode-btn:hover {
  color: #0f172a;
}

.view-mode-btn.active {
  background-color: #2563eb;
  color: #ffffff;
}

/* 3-Column Card Grid */
.char-list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 900px) {
  .char-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.char-list-card {
  position: relative;
  background-color: #f8fbff;
  border: 1.5px solid #c5dcf3;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.char-list-card-badges-bar {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}

.char-list-card.has-badge-red,
.char-list-simple-row.has-badge-red {
  border-color: #ef4444;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.3);
}

.char-list-card.has-badge-yellow,
.char-list-simple-row.has-badge-yellow {
  border-color: #f59e0b;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.char-list-card:hover {
  transform: translateY(-3px);
  border-color: #3b82f6;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.14);
}

.char-list-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #e2effd, #dbeafe);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.char-list-card-awakened {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.char-list-card-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
}

.char-list-card-fallback img {
  width: 68px;
  height: 68px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #93c5fd;
}

.char-list-card-fallback span {
  font-size: 11px;
  color: #475569;
}

.char-list-card-tier {
  font-family: 'Oswald', 'Noto Sans JP', sans-serif;
  font-size: 14.5px;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.char-list-simple-tier-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 800;
  border: 1px solid rgba(0, 0, 0, 0.18);
  white-space: nowrap;
  flex-shrink: 0;
}

.char-list-card-gacha {
  font-size: 12.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  background-color: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  margin-left: auto;
}

.char-list-card-gacha.is-limited,
.char-list-inline-gacha.is-limited {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-color: #fca5a5;
  color: #ffffff;
}

.char-list-card-gacha.is-anniv,
.char-list-inline-gacha.is-anniv {
  background: linear-gradient(135deg, #18181b, #27272a);
  border-color: #facc15;
  box-shadow: 0 2px 10px rgba(250, 204, 21, 0.45);
}

.char-list-card-gacha.is-lumina,
.char-list-inline-gacha.is-lumina {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #bae6fd;
  color: #ffffff;
}

.char-list-inline-gacha {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.char-list-card-body {
  padding: 11px 13px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.char-list-card-name {
  font-size: 15.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}

.char-list-style-tag {
  color: #1d4ed8;
  font-weight: 600;
  font-size: 14px;
  margin-left: 2px;
}

.char-list-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.char-list-card-icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.char-list-icon-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  background-color: #ffffff;
  border: 1px solid #cde0f5;
  border-radius: 5px;
  padding: 2px 7px;
}

.char-list-metric-pill {
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 5px;
  padding: 2px 8px;
  white-space: nowrap;
}

.char-list-metric-pill.is-secondary {
  color: #0369a1;
  background-color: #e0f2fe;
  border-color: #38bdf8;
}

@media (max-width: 560px) {
  .char-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .char-list-card-body {
    padding: 8px 8px 9px;
    gap: 6px;
  }
  .char-list-card-name {
    font-size: 12.5px;
    line-height: 1.3;
  }
  .char-list-style-tag {
    font-size: 11px;
  }
  .char-list-card-badges-bar {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    padding: 0;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    pointer-events: auto;
  }
  .char-list-card-tier {
    font-size: 10.5px;
    padding: 2px 6px;
    box-shadow: none;
  }
  .char-list-card-gacha {
    font-size: 10px;
    padding: 2px 6px;
    box-shadow: none;
    margin-left: 0;
  }
  .char-list-card-meta-row {
    gap: 4px;
  }
  .char-list-card-icons {
    gap: 4px;
    flex-wrap: wrap;
  }
  .char-list-icon-chip {
    font-size: 10.5px;
    padding: 1.5px 5px;
    gap: 3px;
  }
  .char-list-metric-pill {
    font-size: 10.5px;
    padding: 1.5px 6px;
  }
}

/* Simple Horizontal List View */
.char-list-simple-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.char-list-simple-row {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) auto auto minmax(150px, auto);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background-color: #f8fbff;
  border: 1px solid #c5dcf3;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.char-list-simple-row:hover {
  background-color: #eff6ff;
  border-color: #3b82f6;
}

.char-list-simple-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.char-list-simple-thumb {
  width: 34px;
  height: 34px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #b8d1eb;
  background-color: #e2effd;
}

.char-list-simple-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-list-simple-metric {
  justify-self: end;
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 5px;
  padding: 3px 10px;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .char-list-simple-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .char-list-simple-identity {
    grid-column: 1 / -1;
  }
  .char-list-simple-metric {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.char-list-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 16px;
  color: #475569;
  font-size: 14.5px;
}

/* ============================================================
   Home Screen Hub Styles
   ============================================================ */
.home-wrapper {
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 16px 44px;
}

.home-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.home-hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #e7f2ff 100%);
  border: 1px solid #b8d5f4;
  border-radius: 12px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: 0 10px 28px rgba(15, 55, 110, 0.1);
}

.home-hero-main {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1 1 460px;
  min-width: 0;
}

.home-hero-logo-wrap {
  flex-shrink: 0;
}

.home-hero-logo {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid #93c5fd;
  background-color: #0f172a;
}

.home-hero-text {
  min-width: 0;
}

.home-hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.home-game-pill {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  padding: 2px 10px;
  border-radius: 999px;
}

.home-date-pill {
  font-size: 12px;
  font-weight: 600;
  color: #1e3a8a;
  background-color: #e0edff;
  border: 1px solid #b6d3f8;
  padding: 2px 10px;
  border-radius: 999px;
}

.home-hero-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 5px;
}

.home-hero-desc {
  font-size: 13.5px;
  color: #334155;
  line-height: 1.5;
}

.home-stats-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.home-stat-box {
  background-color: #ffffff;
  border: 1px solid #bfd7f2;
  border-radius: 9px;
  padding: 10px 16px;
  min-width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 2px 8px rgba(15, 55, 110, 0.05);
}

.home-stat-num {
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #1d4ed8;
  line-height: 1.1;
}

.home-stat-lbl {
  font-size: 11.5px;
  color: #475569;
  font-weight: 600;
}

.home-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

@media (max-width: 780px) {
  .home-nav-grid {
    grid-template-columns: 1fr;
  }
}

.home-nav-card {
  position: relative;
  overflow: hidden;
  text-align: left;
  background-color: #ffffff;
  border: 1px solid #c3daf3;
  border-radius: 12px;
  padding: 20px 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 55, 110, 0.06);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.home-nav-card:hover {
  transform: translateY(-3px);
  background-color: #f5faff;
  box-shadow: 0 10px 24px rgba(15, 55, 110, 0.14);
}

.home-nav-card.tier-card:hover {
  border-color: #f59e0b;
}

.home-nav-card.list-card:hover {
  border-color: #2563eb;
}

.home-nav-icon {
  position: relative;
  z-index: 2;
  font-size: 34px;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-color: #eaf3ff;
  border: 1px solid #bfd7f2;
}

.home-nav-body {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Miniature Opened-Page Watermark Preview inside Home Nav Cards */
.home-nav-watermark {
  position: absolute;
  right: 8px;
  bottom: -10px;
  width: 230px;
  height: 134px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.44;
  transform: rotate(-5deg);
  transform-origin: bottom right;
  mask-image: linear-gradient(122deg, transparent 4%, rgba(0, 0, 0, 0.45) 38%, rgba(0, 0, 0, 0.96) 85%);
  -webkit-mask-image: linear-gradient(122deg, transparent 4%, rgba(0, 0, 0, 0.45) 38%, rgba(0, 0, 0, 0.96) 85%);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.home-nav-card:hover .home-nav-watermark {
  opacity: 0.66;
  transform: rotate(-3deg) scale(1.03);
}

.wm-frame {
  width: 100%;
  height: 100%;
  border-radius: 9px;
  background: rgba(235, 244, 255, 0.94);
  border: 1px solid rgba(96, 165, 250, 0.55);
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1);
}

.wm-tier-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
  flex: 1;
}

.wm-tier-lbl {
  width: 28px;
  border-radius: 4px;
  font-family: 'Oswald', sans-serif;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  flex-shrink: 0;
}

.wm-tier-lbl.sss { background: #ef4444; color: #fff; }
.wm-tier-lbl.ss  { background: #f97316; color: #fff; }
.wm-tier-lbl.s   { background: #facc15; }
.wm-tier-lbl.a   { background: #a3e635; }

.wm-tier-tiles {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 4px;
  padding: 2px 4px;
}

.wm-tile {
  width: 19px;
  height: 19px;
  border-radius: 4px;
  background: linear-gradient(135deg, #93c5fd, #60a5fa);
  border: 1px solid rgba(37, 99, 235, 0.35);
  flex-shrink: 0;
}

.wm-char-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  flex: 1;
}

.wm-char-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wm-char-art {
  height: 24px;
  background: linear-gradient(135deg, #3b82f6, #38bdf8 55%, #bae6fd);
  position: relative;
}

.wm-char-art::after {
  content: "Tier: S";
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 6px;
  font-weight: 800;
  background: #facc15;
  color: #0f172a;
  padding: 0 3px;
  border-radius: 2px;
}

.wm-char-lines {
  padding: 4px 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wm-line {
  height: 4px;
  border-radius: 2px;
  background: rgba(100, 116, 139, 0.45);
}

.wm-line.short { width: 58%; background: rgba(148, 163, 184, 0.55); }
.wm-line.accent { width: 70%; background: rgba(37, 99, 235, 0.55); }

.wm-scripts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  flex: 1;
}

.wm-script-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(14, 165, 233, 0.4);
  border-radius: 5px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wm-script-top {
  display: flex;
  gap: 4px;
  align-items: stretch;
}

.wm-script-img {
  width: 24px;
  height: 36px;
  border-radius: 3px;
  background: linear-gradient(145deg, #38bdf8, #818cf8);
  flex-shrink: 0;
}

.wm-script-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wm-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 6.5px;
  font-weight: 800;
  padding: 0 4px;
  border-radius: 3px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
}

.wm-pill.cyan { background: rgba(14, 165, 233, 0.85); }
.wm-pill.green { background: rgba(16, 185, 129, 0.85); }
.wm-pill.purple { background: rgba(139, 92, 246, 0.85); }

.wm-calc-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.wm-calc-pills {
  display: flex;
  gap: 3px;
}

.wm-calc-pill {
  flex: 1;
  height: 11px;
  border-radius: 3px;
  background: #dbeafe;
  font-size: 6.5px;
  font-weight: 700;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wm-calc-pill.active {
  background: #f59e0b;
  color: #ffffff;
}

.wm-calc-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  flex: 1;
}

.wm-calc-box {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 5px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}

.wm-calc-num {
  font-family: 'Oswald', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #b45309;
  text-align: center;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 3px;
  padding: 2px 3px;
}

.wm-faq-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.wm-faq-item {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 4px;
  padding: 4px 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wm-faq-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wm-qa-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  font-size: 7px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.wm-qa-dot.q { background: #2563eb; }
.wm-qa-dot.a { background: #059669; }

.wm-fb-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 5px;
  flex: 1;
}

.wm-fb-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 5px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wm-fb-textarea {
  flex: 1;
  background: #f1f7fe;
  border: 1px solid #bfdbfe;
  border-radius: 3px;
}

.wm-fb-btn {
  height: 11px;
  border-radius: 3px;
  background: #2563eb;
}

.home-nav-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.home-nav-title-row h3 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.home-nav-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #1e40af;
  background-color: #e4effd;
  border: 1px solid #c3daf3;
  padding: 2px 9px;
  border-radius: 999px;
}

.home-nav-body p {
  font-size: 13.5px;
  color: #334155;
  line-height: 1.55;
}

.home-nav-cta {
  font-size: 13.5px;
  font-weight: 700;
  color: #1d4ed8;
  margin-top: 2px;
}

.home-nav-card.tier-card .home-nav-cta {
  color: #b45309;
}

.home-bottom-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}

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

.home-panel {
  background-color: #ffffff;
  border: 1px solid #c5dcf3;
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(15, 55, 110, 0.06);
}

.home-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid #d6e6f7;
}

.home-panel-header h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: #0f172a;
}

.home-panel-more-btn {
  background: none;
  border: none;
  color: #1d4ed8;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.home-panel-more-btn:hover {
  text-decoration: underline;
}

.home-recent-chars-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 560px) {
  .home-recent-chars-grid {
    grid-template-columns: 1fr;
  }
}

.home-recent-char-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background-color: #f6faff;
  border: 1px solid #cde0f5;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.home-recent-char-item:hover {
  border-color: #3b82f6;
  background-color: #e8f2ff;
}

.home-recent-char-thumb {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #e2effd;
  border: 1px solid #b8d1eb;
}

.home-recent-char-info {
  min-width: 0;
  flex: 1;
}

.home-recent-char-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-recent-char-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 11.5px;
  color: #475569;
}

.home-history-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.home-history-row {
  padding: 7px 10px;
  border-radius: 6px;
  background-color: #f6faff;
  border: 1px solid #cde0f5;
  font-size: 12.5px;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-history-row.clickable {
  cursor: pointer;
}

.home-history-row.clickable:hover {
  border-color: #3b82f6;
  background-color: #edf5ff;
}

.home-history-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #475569;
}

.home-author-sns {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #d6e6f7;
}

.home-author-sns-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.home-author-sns-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.perf-ability-note {
  margin-top: 8px;
  padding: 7px 11px;
  background-color: #f1f5f9;
  border-left: 3px solid #64748b;
  border-radius: 0 4px 4px 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #334155;
  white-space: pre-wrap;
}

.perf-ability-note strong {
  font-weight: 700;
  color: #0f172a;
  margin-right: 6px;
}

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

/* ============================================================
   Home Nav Extra Cards & Official Links
   ============================================================ */
.home-nav-card.faq-card:hover {
  border-color: #10b981;
}
.home-nav-card.faq-card .home-nav-cta {
  color: #047857;
}

.home-nav-card.feedback-card:hover {
  border-color: #a855f7;
}
.home-nav-card.feedback-card .home-nav-cta {
  color: #7e22ce;
}

.official-links-home-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.official-links-home-grid .sns-link-btn {
  flex: 1 1 220px;
}

.sns-link-btn.official {
  background: linear-gradient(135deg, #ffffff, #edf5ff);
  border-color: #b8d1eb;
  color: #0f172a;
}

.sns-link-btn.official:hover {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #f0f7ff, #dbeafe);
}

.sns-link-btn.discord {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border-color: #a5b4fc;
  color: #312e81;
}

.official-links-editor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.official-link-editor-row {
  display: grid;
  grid-template-columns: 130px 1fr 1.4fr auto;
  gap: 6px;
  align-items: center;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 8px;
  border-radius: 6px;
}

.official-link-editor-row select,
.official-link-editor-row input {
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13px;
  min-width: 0;
}

@media (max-width: 640px) {
  .official-link-editor-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Community Pages (Q&A & Feedback Board)
   ============================================================ */
.community-page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 44px;
}

.community-page-container {
  background-color: #ffffff;
  border: 1px solid #c5dcf3;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(15, 55, 110, 0.08);
}

.community-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #d6e6f7;
}

.community-title-block h2 {
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.community-subtitle {
  font-size: 13.5px;
  color: #475569;
}

.community-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Q&A Styles */
.faq-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

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

.faq-expand-actions {
  display: flex;
  gap: 8px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background-color: #f8fbff;
  border: 1px solid #c5dcf3;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.faq-item.open {
  border-color: #2563eb;
}

.faq-question-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: #0f172a;
}

.faq-question-btn:hover {
  background-color: #edf5ff;
}

.faq-q-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.faq-q-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background-color: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.faq-cat-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: #1d4ed8;
  background-color: #dbeafe;
  border: 1px solid #93c5fd;
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.faq-q-text {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}

.faq-chevron {
  font-size: 12px;
  color: #475569;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: #2563eb;
}

.faq-answer-panel {
  border-top: 1px solid #cde0f5;
  background-color: #ffffff;
  padding: 14px 16px;
}

.faq-answer-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.faq-a-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background-color: #059669;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

.faq-answer-body {
  font-size: 14px;
  line-height: 1.7;
  color: #1e293b;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
}

.faq-item-admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #d6e6f7;
}

/* Feedback Board Styles */
.feedback-notice-banner {
  background-color: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e3a8a;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.feedback-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 18px;
  align-items: start;
}

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

.feedback-side-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feedback-card {
  background-color: #f8fbff;
  border: 1px solid #c5dcf3;
  border-radius: 10px;
  padding: 18px;
}

.feedback-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 14px;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.feedback-label {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.feedback-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-cat-pill {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid #b8d1eb;
  background-color: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.feedback-cat-pill:hover {
  border-color: #3b82f6;
  background-color: #eff6ff;
  color: #1d4ed8;
}

.feedback-cat-pill.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.feedback-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .feedback-row-2 {
    grid-template-columns: 1fr;
  }
}

.feedback-input,
.feedback-textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid #b8d1eb;
  background-color: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.feedback-input:focus,
.feedback-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.feedback-submit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feedback-submit-result {
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
}

.feedback-submit-result.success {
  background-color: #dcfce7;
  border: 1px solid #4ade80;
  color: #166534;
}

.feedback-submit-result.info {
  background-color: #fef3c7;
  border: 1px solid #fbbf24;
  color: #92400e;
}

.feedback-admin-hint,
.feedback-log-note {
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 10px;
}

.feedback-gas-guide {
  margin-top: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  background-color: #f8fafc;
  font-size: 12px;
}

.feedback-gas-guide summary {
  cursor: pointer;
  font-weight: 800;
  color: #1e40af;
}

.feedback-gas-guide-body {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #334155;
  line-height: 1.5;
}

.feedback-gas-code {
  background-color: #0f172a;
  color: #e2e8f0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre;
}

.feedback-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.feedback-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 460px;
  overflow-y: auto;
}

.feedback-log-item {
  background-color: #ffffff;
  border: 1px solid #cde0f5;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feedback-log-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.feedback-log-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background-color: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.feedback-log-meta {
  font-size: 11.5px;
  color: #475569;
}

.feedback-log-body {
  font-size: 13px;
  color: #1e293b;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.feedback-gform-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feedback-gform-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.feedback-gform-open-btn {
  text-decoration: none;
  flex-shrink: 0;
}

.feedback-gform-embed-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-gform-iframe {
  width: 100%;
  height: 760px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background-color: #ffffff;
}

.feedback-gform-fallback-note {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}

.feedback-gform-external-box,
.feedback-gform-empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 36px 20px;
  border: 1.5px dashed #93c5fd;
  border-radius: 10px;
  background-color: #ffffff;
}

.feedback-gform-ext-icon {
  font-size: 38px;
  line-height: 1;
}

.feedback-gform-ext-desc {
  font-size: 14px;
  color: #334155;
  line-height: 1.6;
  margin: 0;
}

.feedback-gform-ext-cta {
  text-decoration: none;
  padding: 10px 22px;
  font-size: 15px;
}

.feedback-gform-admin-cue {
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 4px 0 0;
}

/* ============================================================
   Site Footer (Disclaimers & Bottom Admin Login)
   ============================================================ */
.site-footer {
  margin-top: 32px;
  background-color: #e3eefb;
  border-top: 1px solid #bfd7f2;
  color: #334155;
}

.site-footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 22px 16px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-disclaimer-box {
  background-color: #f4f9ff;
  border: 1px solid #c8ddf3;
  border-radius: 8px;
  padding: 14px 16px;
}

.footer-disclaimer-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.footer-disclaimer-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: #334155;
}

.footer-disclaimer-list strong {
  color: #0f172a;
}

.footer-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid #c5dcf3;
}

.footer-copyright {
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
}

.footer-bottom-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-text-link {
  background: none;
  border: none;
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}

.footer-text-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.footer-auth-btn {
  background-color: #ffffff;
  border: 1px solid #b8d1eb;
  color: #1e3a5f;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.footer-auth-btn:hover {
  background-color: #dbeafe;
  border-color: #3b82f6;
  color: #1d4ed8;
}

/* ============================================================
   Scripts Catalog Page & Detail Styles
   ============================================================ */
.home-nav-card.scripts-card:hover {
  border-color: #0284c7;
}
.home-nav-card.scripts-card .home-nav-cta {
  color: #0e7490;
}

.scripts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 960px) {
  .scripts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .scripts-grid:not(.simple-mode) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .scripts-grid:not(.simple-mode) .script-card-top {
    flex-direction: column;
    padding: 8px;
    gap: 7px;
    align-items: stretch;
  }
  .scripts-grid:not(.simple-mode) .script-card-media {
    width: 100%;
    max-width: 112px;
    margin: 0 auto;
  }
  .scripts-grid:not(.simple-mode) .script-card-badges {
    gap: 3px;
  }
  .scripts-grid:not(.simple-mode) .script-rarity-badge,
  .scripts-grid:not(.simple-mode) .script-role-pill,
  .scripts-grid:not(.simple-mode) .script-gacha-badge {
    font-size: 9.5px;
    padding: 1px 5px;
  }
  .scripts-grid:not(.simple-mode) .script-card-name {
    font-size: 12.5px;
    line-height: 1.3;
  }
  .scripts-grid:not(.simple-mode) .script-card-date {
    font-size: 9.5px;
    padding: 1px 5px;
  }
  .scripts-grid:not(.simple-mode) .script-card-stats-mini {
    padding: 4px 5px;
    font-size: 10.5px;
    gap: 3px 4px;
  }
  .scripts-grid:not(.simple-mode) .script-card-effects {
    padding: 7px 8px 9px;
    gap: 4px;
  }
  .scripts-grid:not(.simple-mode) .script-eff-line {
    font-size: 10.5px;
    line-height: 1.35;
    gap: 3px;
    flex-direction: column;
  }
  .scripts-grid:not(.simple-mode) .script-eff-tag {
    font-size: 10px;
  }
}

.scripts-grid.simple-mode {
  grid-template-columns: 1fr;
  gap: 8px;
}

.script-card {
  background-color: #f8fbff;
  border: 1px solid #c5dcf3;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.script-card:hover {
  transform: translateY(-3px);
  border-color: #0284c7;
  box-shadow: 0 8px 22px rgba(15, 55, 110, 0.12);
}

.script-card-top {
  display: flex;
  gap: 12px;
  padding: 12px;
  align-items: stretch;
}

.script-card-media {
  position: relative;
  width: 96px;
  aspect-ratio: 5 / 8;
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e2effd, #dbeafe);
  border: 1px solid #b8d1eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.script-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.script-card-placeholder {
  font-size: 11px;
  color: #475569;
  text-align: center;
  padding: 6px;
}

.script-rarity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

.script-rarity-badge.rarity-ssr {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
}
.script-rarity-badge.rarity-sr {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #ffffff;
}
.script-rarity-badge.rarity-r {
  background-color: #475569;
  color: #f8fafc;
}

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

.script-card-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.script-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
  background-color: #ffffff;
  border: 1px solid #cde0f5;
  padding: 1px 7px;
  border-radius: 999px;
}

.script-card-name {
  font-size: 15.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
}

.script-card-date {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 11px;
  font-weight: 700;
  color: #92400e;
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 5px;
  padding: 1.5px 7px;
  line-height: 1.35;
}

.script-date-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.4;
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
}

.script-card-stats-mini {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  background-color: #ffffff;
  border: 1px solid #cde0f5;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11.5px;
  color: #334155;
}

.script-card-stats-mini span strong {
  color: #0f172a;
  margin-left: 4px;
}

.script-card-effects {
  border-top: 1px solid #d6e6f7;
  padding: 9px 12px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background-color: #eef5fd;
}

.script-eff-line {
  font-size: 12px;
  line-height: 1.45;
  color: #1e293b;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.script-eff-tag {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 0;
  letter-spacing: 0.3px;
}

.script-eff-tag.s1 { background-color: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.script-eff-tag.s2 { background-color: #dcfce7; color: #166534; border: 1px solid #86efac; }
.script-eff-tag.s3 { background-color: #f3e8ff; color: #6b21a8; border: 1px solid #d8b4fe; }

/* Simple List Row for Scripts */
.script-simple-row {
  display: grid;
  grid-template-columns: 52px minmax(150px, 1.1fr) minmax(200px, 2fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background-color: #f8fbff;
  border: 1px solid #c5dcf3;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.script-simple-row:hover {
  border-color: #0284c7;
  background-color: #eff6ff;
}

.script-simple-thumb {
  width: 44px;
  height: 68px;
  border-radius: 5px;
  object-fit: cover;
  background-color: #e2effd;
  border: 1px solid #b8d1eb;
}

.script-simple-skills {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #1e293b;
  min-width: 0;
}

.script-simple-skill-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 820px) {
  .script-simple-row {
    grid-template-columns: 46px 1fr auto;
  }
  .script-simple-skills {
    grid-column: 1 / -1;
  }
}

.script-preview-card {
  width: 88px;
  height: 136px;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.script-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Script Detail Modal */
.script-detail-modal-dialog {
  max-width: min(1340px, 96vw);
  overscroll-behavior-y: contain;
}

.modal-swipe-handle {
  display: none;
}

.modal-dialog.is-swiping {
  will-change: transform, opacity;
  user-select: none;
  -webkit-user-select: none;
}

@media (max-width: 768px) {
  #script-detail-modal .detail-sticky-close-bar {
    position: sticky;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 38px;
  }

  #script-detail-modal .modal-swipe-handle {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.36);
    pointer-events: none;
  }
}

.script-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

@media (max-width: 1020px) {
  .script-detail-layout {
    grid-template-columns: 1fr;
  }
}

.script-detail-split {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 700px) {
  .script-detail-split {
    grid-template-columns: 1fr;
  }
}

.script-matched-chars-sidebar {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background-color: #f8fbff;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: min(72vh, 680px);
}

.script-matched-chars-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1.5px solid #cbd5e1;
}

.script-matched-chars-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
}

.script-matched-chars-sub {
  font-size: 11.5px;
  color: #475569;
  line-height: 1.4;
}

.script-matched-chars-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding-right: 2px;
}

.script-matched-char-btn {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #0f172a;
  cursor: pointer;
  transition: border-color 0.14s, background-color 0.14s, transform 0.14s;
}

.script-matched-char-btn:hover {
  border-color: #2563eb;
  background-color: #eff6ff;
  transform: translateX(2px);
}

.script-matched-char-btn.has-badge-red {
  border-color: #ef4444;
}

.script-matched-char-btn.has-badge-yellow {
  border-color: #f59e0b;
}

.script-matched-char-thumb {
  width: 38px;
  height: 38px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #e2e8f0;
  border: 1px solid #cbd5e1;
}

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

.script-matched-char-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
}

.script-matched-char-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 10.5px;
  color: #475569;
}

.script-matched-tier-tag {
  font-family: var(--font-tier);
  font-size: 10.5px;
  font-weight: 800;
  padding: 0 5px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.script-matched-chars-empty {
  font-size: 12.5px;
  color: #64748b;
  padding: 12px 6px;
  text-align: center;
}

.script-detail-art-box {
  position: relative;
  background-color: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 5 / 8;
  max-width: 260px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.script-detail-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
  transition: transform 0.25s ease;
}

.script-detail-art-img:hover {
  transform: scale(1.02);
}

.script-detail-art-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 16px 10px 6px;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.script-detail-info-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: #0f172a;
}

.script-detail-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 8px;
}

.script-detail-title-row h2 {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.script-detail-effect-card {
  border: 1px solid #94a3b8;
  border-radius: 6px;
  padding: 10px 13px;
  background-color: #f8fafc;
}

.script-detail-effect-head {
  font-size: 15.5px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.script-detail-effect-head .script-eff-tag {
  font-size: 15px;
  font-weight: 800;
  padding: 3px 11px;
}

.script-detail-effect-body {
  font-size: 14.5px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.55;
}

/* Script Limited / Anniv Badges & Quick Switch */
.script-card.has-badge-red {
  border-color: #ef4444;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.45);
}

.script-card.has-badge-yellow {
  border-color: #facc15;
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.5);
}

.script-simple-row.has-badge-red {
  border-color: #ef4444;
}

.script-simple-row.has-badge-yellow {
  border-color: #facc15;
}

.script-gacha-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.4;
}

.script-gacha-badge.type-limited {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border: 1px solid #fca5a5;
  color: #ffffff;
}

.script-gacha-badge.type-anniv {
  background: linear-gradient(135deg, #18181b, #27272a);
  border: 1.5px solid #facc15;
  box-shadow: 0 1px 6px rgba(250, 204, 21, 0.35);
}

.script-gacha-badge.type-dist {
  background: linear-gradient(135deg, #059669, #047857);
  border: 1px solid #6ee7b7;
  color: #ffffff;
}

.script-gacha-badge.type-event-dist {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  border: 1px solid #fdba74;
  color: #ffffff;
}

.script-lumina-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  color: #075985;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  border: 1px solid #38bdf8;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.3;
}

.script-gacha-quick-btn.is-lumina.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #38bdf8;
  color: #ffffff;
}

.script-gacha-badge.type-pass {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  border: 1px solid #c4b5fd;
  color: #ffffff;
}

.script-gacha-badge.type-other {
  background: linear-gradient(135deg, #64748b, #475569);
  border: 1px solid #cbd5e1;
  color: #ffffff;
}

.script-detail-gacha-quickbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.script-gacha-quick-btn {
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s;
}

.script-gacha-quick-btn:hover {
  border-color: #3b82f6;
}

.script-gacha-quick-btn.active {
  background-color: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
}

.script-gacha-quick-btn.active.is-limited {
  background-color: #dc2626;
  border-color: #b91c1c;
}

.script-gacha-quick-btn.active.is-anniv {
  background-color: #1e293b;
  border-color: #facc15;
}

.script-gacha-quick-btn.active.is-dist {
  background-color: #059669;
  border-color: #047857;
}

.script-gacha-quick-btn.active.is-event-dist {
  background-color: #ea580c;
  border-color: #c2410c;
}

.script-gacha-quick-btn.active.is-pass {
  background-color: #7c3aed;
  border-color: #5b21b6;
}

.script-gacha-quick-btn.active.is-other {
  background-color: #475569;
  border-color: #334155;
}

.script-lv-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: middle;
}

.script-lv-tag.is-lv80 {
  background-color: #e0f2fe;
  border: 1px solid #38bdf8;
  color: #0369a1;
}

.script-detail-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.script-detail-stats-head .perf-sub-title {
  margin-bottom: 0;
}

.script-lv-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #e2e8f0;
  padding: 2px;
  border-radius: 6px;
}

.script-lv-btn {
  padding: 2px 9px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s;
}

.script-lv-btn.active {
  background-color: #2563eb;
  color: #ffffff;
}

/* Script Quick Presets & S3 Details */
.script-quick-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.script-quick-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  margin-right: 2px;
}

.script-quick-chip,
.script-quick-num {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background-color: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

.script-quick-chip:hover,
.script-quick-num:hover {
  background-color: #eff6ff;
  border-color: #60a5fa;
  color: #1d4ed8;
}

.script-quick-chip.active,
.script-quick-num.active {
  background-color: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
}

.script-s3-advanced-details {
  margin: 8px 0 12px;
  padding: 8px 12px;
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
}

.script-s3-advanced-details summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  user-select: none;
}

/* Recommended Scripts inside Character Detail Modal */
.detail-rec-scripts-box {
  border: 1px solid #000;
  padding: 16px 18px;
  background-color: #f8fafc;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-rec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 2px solid #000;
  padding-bottom: 8px;
}

.detail-rec-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-rec-count {
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
  background-color: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  padding: 2px 9px;
}

.detail-rec-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-rec-mode-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s;
}

.detail-rec-mode-btn:hover {
  border-color: #60a5fa;
  color: #1d4ed8;
}

.detail-rec-mode-btn.active {
  background-color: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
}

.detail-rec-sort-select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
}

.char-rec-scripts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.char-rec-scripts-grid.is-simple-mode {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: min(74vh, 860px);
  overflow-y: auto;
  padding-right: 3px;
}

.char-rec-simple-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s;
}

.char-rec-simple-row:hover {
  border-color: #3b82f6;
  background-color: #eff6ff;
}

.char-rec-simple-row.has-both-match {
  border-color: #f59e0b;
}

.char-rec-simple-thumb {
  width: 32px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  flex-shrink: 0;
  background-color: #e2e8f0;
}

.char-rec-simple-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.char-rec-simple-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.char-rec-simple-title {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 120px;
  flex: 1 1 160px;
  overflow: hidden;
}

.char-rec-simple-title > *:not(.char-rec-simple-name) {
  flex-shrink: 0;
  white-space: nowrap;
}

.char-rec-simple-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  flex-shrink: 0;
  max-width: 100%;
}

.char-rec-simple-name {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.char-rec-simple-atk {
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  flex-shrink: 0;
}

.char-rec-simple-effects {
  font-size: 10.5px;
  color: #475569;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-rec-view-toggle {
  display: inline-flex;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
  background-color: #ffffff;
}

.detail-rec-view-btn {
  padding: 3px 8px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.detail-rec-view-btn.active {
  background-color: #1e293b;
  color: #ffffff;
}

@media (max-width: 1139px) {
  .char-rec-scripts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .char-rec-scripts-grid {
    grid-template-columns: 1fr;
  }
}

.char-rec-script-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
}

.char-rec-script-card:hover {
  transform: translateY(-2px);
  border-color: #3b82f6;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.14);
}

.char-rec-script-card.has-both-match {
  border-color: #f59e0b;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.char-rec-script-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.char-rec-script-thumb {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  flex-shrink: 0;
  background-color: #e2e8f0;
}

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

.char-rec-script-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
}

.char-rec-match-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.char-rec-match-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.char-rec-match-pill.is-both {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

.char-rec-match-pill.is-s2 {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.char-rec-match-pill.is-s3 {
  background-color: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #d8b4fe;
}

.char-rec-match-pill.is-none {
  background-color: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.char-rec-script-effects {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11.5px;
  color: #334155;
  border-top: 1px solid #e2e8f0;
  padding-top: 6px;
  line-height: 1.4;
}

@media (max-width: 1260px) {
  .detail-rec-scripts-box {
    padding: 12px 14px;
    gap: 10px;
  }
  .detail-rec-header {
    gap: 8px;
    padding-bottom: 6px;
  }
  .char-rec-script-card {
    padding: 8px 9px;
    gap: 6px;
  }
  .char-rec-script-top {
    gap: 8px;
  }
  .char-rec-script-thumb {
    width: 46px;
    height: 62px;
  }
  .char-rec-script-name {
    font-size: 12.5px;
  }
  .char-rec-script-effects {
    font-size: 11px;
    padding-top: 5px;
  }
  .char-rec-simple-thumb {
    width: 28px;
    height: 37px;
  }
  .char-rec-scripts-grid.is-simple-mode {
    max-height: min(58vh, 620px);
  }
}

/* ============================================================
   PC & Mobile Responsive Enhancements
   ============================================================ */
.page-tabs-inner {
  flex-wrap: wrap;
  overflow: visible;
}

.page-tab-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (min-width: 769px) {
  .header-container {
    padding: 8px 18px;
    gap: 10px 14px;
  }
  .header-brand {
    flex-shrink: 0;
  }
  .page-tabs-bar {
    flex: 1 1 420px;
    min-width: 0;
    background: transparent !important;
    border-top: none !important;
  }
  .page-tabs-inner {
    max-width: 100%;
    margin: 0;
    padding: 0;
    gap: 5px;
    justify-content: flex-start;
  }
  .page-tabs-inner > .page-tab-btn {
    flex: 0 1 auto;
    min-width: 0;
    padding: 6px 9px;
    min-height: 34px;
    font-size: 12px;
    white-space: nowrap;
  }
  .page-tabs-inner > .nav-dropdown-wrap {
    flex: 0 0 auto;
    min-width: 0;
  }
  .page-tabs-inner > .nav-dropdown-wrap > .page-tab-btn {
    width: auto;
    justify-content: center;
    padding: 6px 10px;
    min-height: 34px;
    font-size: 12px;
    white-space: nowrap;
  }
  .header-actions {
    flex-shrink: 0;
    margin-left: auto;
  }
  .admin-actions-group {
    flex: 0 0 100%;
  }
}

.nav-dropdown-wrap {
  position: relative;
  display: inline-flex;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-caret {
  font-size: 11px;
  opacity: 0.8;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 245px;
  max-width: calc(100vw - 24px);
  background-color: #ffffff;
  border: 1px solid #bfd7f2;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 28px rgba(15, 55, 110, 0.16);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-dropdown-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.nav-dropdown-item:hover {
  background-color: #eff6ff;
  color: #1d4ed8;
}

.nav-dropdown-item.active {
  background-color: #2563eb;
  color: #ffffff;
}

.nav-soon-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  flex-shrink: 0;
}

.home-nav-section-head {
  font-size: 13.5px;
  font-weight: 800;
  color: #3b5575;
  letter-spacing: 0.4px;
  margin: 16px 0 8px;
  padding-left: 4px;
}

.home-nav-card.is-planned {
  border-style: dashed;
  border-color: #b8d1eb;
}

.home-nav-card.is-planned:hover {
  border-color: #3b82f6;
}

.home-nav-badge.is-soon {
  background-color: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.planned-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.planned-category-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background-color: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
}

.planned-status-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
}

.planned-page-card {
  background-color: #f8fbff;
  border: 1px solid #c5dcf3;
  border-radius: 10px;
  padding: 20px;
}

.planned-page-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 12px 0;
}

.planned-feature-list {
  margin: 0 0 18px 0;
  padding-left: 20px;
  color: #334155;
  font-size: 13.5px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.planned-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Home Community Row (Profile/ID/Achievements) */
.home-community-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

.home-profile-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-profile-empty {
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

.home-profile-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.home-profile-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.author-id-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 7px;
  background-color: #f2f7fe;
  border: 1px solid #bfd7f2;
  font-size: 12.5px;
  color: #334155;
}

.author-id-row strong {
  color: #1d4ed8;
  letter-spacing: 0.4px;
}

.profile-copy-id-btn {
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid #93c5fd;
  background-color: #ffffff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.profile-copy-id-btn:hover {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.home-profile-bio {
  font-size: 13.5px;
  color: #1e293b;
  line-height: 1.65;
  background-color: #f4f9ff;
  border: 1px solid #cde0f5;
  border-radius: 8px;
  padding: 10px 12px;
}

.home-profile-ach-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-profile-ach-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #b45309;
}

.home-profile-ach-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.home-profile-ach-list li {
  font-size: 13px;
  color: #78350f;
  background-color: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 6px 10px;
}

.author-profile-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #d6e6f7;
}

.author-bio-mini {
  font-size: 12px;
  color: #334155;
  line-height: 1.5;
}

.author-ach-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.profile-ach-chip {
  font-size: 11px;
  font-weight: 700;
  color: #92400e;
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 5px;
  padding: 2px 7px;
}

/* Phase 3: Separated Evaluations, Tier Transitions/History, Editor Script Picks */
.eval-groups-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eval-cat-block {
  border-left: 3px solid #cbd5e1;
  padding-left: 12px;
}

.eval-cat-title {
  margin-bottom: 5px;
}

.eval-cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  color: #ffffff;
}

.eval-cat-badge.is-seal { background-color: #dc2626; }
.eval-cat-badge.is-babel { background-color: #7c3aed; }
.eval-cat-badge.is-conquest { background-color: #0284c7; }
.eval-cat-badge.is-general { background-color: #334155; }

.detail-tier-arrow {
  font-size: 20px;
  font-weight: 900;
  color: #dc2626;
  margin: 0 2px;
}

.detail-tier-change-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}

.detail-tier-reason-pill {
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 5px;
  font-weight: 700;
}

.detail-tier-history-details {
  margin-top: 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 14px;
  background-color: #f8fbff;
  font-size: 14px;
  color: #334155;
}

.detail-tier-history-details summary,
.detail-tier-history-title {
  font-size: 15.5px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.4;
}

.detail-tier-history-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
}

.detail-tier-history-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  background-color: #ffffff;
  border: 1.5px solid #dbe6f5;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
}

.detail-tier-history-list .th-date {
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.detail-tier-history-list .th-move {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

.detail-tier-history-list .th-tier-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 9px;
  border-radius: 5px;
  font-family: var(--font-tier);
  font-size: 14.5px;
  font-weight: 800;
  background-color: #e2e8f0;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  line-height: 1.25;
}

.detail-tier-history-list .th-arrow {
  font-weight: 900;
  color: #64748b;
}

.detail-tier-history-list .th-reason {
  color: #78350f;
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

.detail-tier-history-list .th-del-btn {
  margin-left: auto;
  border: 1px solid #fecaca;
  background-color: #fff1f2;
  color: #dc2626;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 800;
  width: 24px;
  height: 24px;
  line-height: 22px;
  padding: 0;
  cursor: pointer;
}

.detail-tier-history-list .th-del-btn:hover {
  background-color: #fee2e2;
  border-color: #ef4444;
}

.th-bulk-bar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px 10px;
  background-color: #eef5fd;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.th-bulk-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  user-select: none;
}

.th-bulk-del-btn,
.th-bulk-clear-btn {
  font-size: 12.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
}

.th-bulk-del-btn {
  border: 1px solid #fca5a5;
  background-color: #fef2f2;
  color: #dc2626;
}

.th-bulk-del-btn:hover:not(:disabled) {
  background-color: #fee2e2;
}

.th-bulk-del-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.th-bulk-clear-btn {
  margin-left: auto;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #475569;
}

.th-bulk-clear-btn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.detail-tier-history-list .th-row-cb {
  cursor: pointer;
  flex-shrink: 0;
}

.detail-rec-mode-btn.is-editor-tab {
  border-color: #f59e0b;
  color: #b45309;
  background-color: #fffbeb;
}

.detail-rec-mode-btn.is-editor-tab.active {
  background-color: #d97706;
  border-color: #b45309;
  color: #ffffff;
}

.char-rec-editor-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  background-color: #fffbeb;
  border: 1px solid #fcd34d;
}

.char-rec-editor-label {
  font-size: 11.5px;
  font-weight: 800;
  color: #92400e;
}

.char-rec-script-card.is-editor-pick,
.char-rec-simple-row.is-editor-pick {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25);
}

.char-rec-editor-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.35;
}

.char-rec-editor-pill.is-compact {
  padding: 0 5px;
  font-size: 10px;
}

.char-rec-editor-pill.is-rank-1 {
  background: linear-gradient(135deg, #fef08a, #fde047);
  border-color: #ca8a04;
  color: #713f12;
}

.char-rec-editor-pill.is-rank-2 {
  background-color: #f1f5f9;
  border-color: #94a3b8;
  color: #334155;
}

.char-rec-editor-pill.is-rank-3 {
  background-color: #ffedd5;
  border-color: #ea580c;
  color: #9a3412;
}

.char-rec-order-controls {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.char-rec-rank-select {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid #f59e0b;
  background-color: #fffbeb;
  color: #92400e;
  cursor: pointer;
}

.char-rec-order-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.char-rec-order-btn:hover:not(:disabled) {
  border-color: #f59e0b;
  background-color: #fffbeb;
  color: #b45309;
}

.char-rec-order-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.char-rec-priority-hint {
  font-size: 11.5px;
  font-weight: 800;
  color: #92400e;
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 4px 10px;
}

.video-script-rank-tag {
  font-size: 11px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  flex-shrink: 0;
}

.video-script-rank-tag.is-rank-1 {
  background: linear-gradient(135deg, #fef08a, #fde047);
  border-color: #ca8a04;
  color: #713f12;
}

.video-script-rank-tag.is-rank-2 {
  background-color: #e2e8f0;
  border-color: #94a3b8;
  color: #1e293b;
}

.video-script-rank-tag.is-rank-3 {
  background-color: #ffedd5;
  border-color: #ea580c;
  color: #9a3412;
}

.char-rec-star-btn {
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #475569;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.char-rec-star-btn:hover {
  border-color: #f59e0b;
  color: #b45309;
}

.char-rec-star-btn.active {
  background-color: #f59e0b;
  border-color: #d97706;
  color: #ffffff;
}

/* Phase 4: Admin Video Studio View */
.video-studio-controls {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-studio-controls-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.video-studio-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.video-studio-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.video-studio-checkboxes,
.video-studio-tier-override {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.video-ctrl-label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-right: 4px;
}

.video-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.video-check-pill.active {
  background-color: #0f766e;
  border-color: #0d9488;
  color: #ffffff;
}

.video-reason-quick-input {
  flex: 1 1 240px;
  padding: 5px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12.5px;
  background-color: #ffffff;
  color: #0f172a;
}

.video-studio-capture {
  background-color: #ffffff;
  border: 2px solid #0f172a;
  border-radius: 10px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  color: #0f172a;
}

.video-studio-capture.has-memo,
.video-studio-capture.has-left-col {
  grid-template-columns: 345px minmax(0, 1fr);
  align-items: stretch;
}

@media (max-width: 900px) {
  .video-studio-capture.has-memo,
  .video-studio-capture.has-left-col {
    grid-template-columns: 1fr;
  }
}

.video-studio-left-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.video-left-skill-group {
  background-color: #f8fafc;
  border: 1.5px solid #2563eb;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-left-skill-group .video-left-group-header {
  color: #1d4ed8;
  border-bottom-color: #bfdbfe;
}

.video-left-subcard.is-skill {
  border-color: #60a5fa;
  background-color: #eff6ff;
}

.video-left-subcard.is-blade {
  border-color: #a78bfa;
  background-color: #f5f3ff;
}

.video-left-trait-group {
  background-color: #f8fafc;
  border: 1.5px solid #0284c7;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-left-group-header {
  font-size: 13px;
  font-weight: 800;
  color: #0369a1;
  border-bottom: 1px solid #bae6fd;
  padding-bottom: 5px;
}

.video-left-trait-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-left-subcard {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  background-color: #ffffff;
}

.video-left-subcard.is-trait {
  border-color: #818cf8;
  background-color: #eef2ff;
}

.video-left-subcard.is-star4 {
  border-color: #38bdf8;
  background-color: #f0f9ff;
}

.video-left-subcard.is-star5 {
  border-color: #f59e0b;
  background-color: #fffbeb;
}

.video-left-subtitle {
  font-size: 12.5px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.video-left-subbody {
  font-size: 12.5px;
  line-height: 1.55;
  color: #1e293b;
  white-space: pre-wrap;
  word-break: break-word;
}

.video-ctrl-memo-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px dashed #cbd5e1;
}

.video-ctrl-memo-textarea {
  flex: 1 1 280px;
  padding: 6px 10px;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  font-size: 12.5px;
  font-family: inherit;
  background-color: #fffbeb;
  color: #1e293b;
}

.video-tier-connector {
  font-size: 12.5px;
  font-weight: 800;
  color: #0f172a;
}

.video-tier-transition-phrase {
  font-size: 12px;
  font-weight: 700;
  color: #b91c1c;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 5px;
  padding: 2px 8px;
}

.eval-cat-badge.is-memo {
  background-color: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
}

.video-eval-memo-block {
  border-left-color: #f59e0b;
  background-color: #fffbeb;
  padding: 6px 10px 6px 12px;
  border-radius: 0 6px 6px 0;
}

.video-capture-size-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #0369a1;
  background-color: #e0f2fe;
  border: 1px solid #7dd3fc;
  border-radius: 999px;
  padding: 2px 10px;
}

.video-eval-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.video-eval-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #065f46;
  background-color: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 999px;
  padding: 2px 10px;
}

.video-eval-reset-btn {
  background: #ffffff;
  border: 1px solid #10b981;
  color: #047857;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.video-eval-reset-btn:hover {
  background: #d1fae5;
}

.video-eval-memo-only {
  border-left-color: #0f766e;
  padding-left: 12px;
}

.video-studio-memo-col {
  background-color: #fffbeb;
  border: 1.5px solid #f59e0b;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-memo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #92400e;
}

.video-memo-saved-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background-color: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
}

.video-memo-add-btn {
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid #d97706;
  background-color: #fef3c7;
  color: #92400e;
  cursor: pointer;
}

.video-memo-add-btn:hover {
  background-color: #fde68a;
}

.video-memo-source-strip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #fcd34d;
}

.video-memo-radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 3px 9px;
  cursor: pointer;
  width: fit-content;
}

.video-memo-radio-pill.active {
  background-color: #0f766e;
  border-color: #0d9488;
  color: #ffffff;
}

.video-memo-radio-hint {
  font-size: 10.5px;
  color: #78350f;
}

.video-memo-records-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-memo-record-card {
  background-color: #ffffff;
  border: 1.5px solid #fde68a;
  border-radius: 7px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.video-memo-record-card.is-selected-eval {
  border: 2px solid #0f766e;
  background-color: #f0fdfa;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.14);
}

.video-memo-record-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.video-memo-record-radio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #0f766e;
  cursor: pointer;
}

.video-memo-record-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.video-memo-record-date {
  font-size: 10px;
  color: #64748b;
}

.video-memo-del-btn {
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.video-memo-title-input {
  width: 100%;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 3px 7px;
  background-color: #f8fafc;
}

.video-memo-record-textarea,
.video-memo-record-print {
  width: 100%;
  min-height: 62px;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  color: #1e293b;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 6px 8px;
  resize: vertical;
  word-break: break-word;
}

.video-memo-history-box {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.video-memo-hist-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  user-select: none;
  flex-wrap: wrap;
}

.video-memo-hist-synced {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 800;
  color: #059669;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 0 6px;
}

.video-memo-hist-fields {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px;
}

.video-memo-hist-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.video-memo-hist-lbl {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  min-width: 26px;
}

.video-memo-hist-date-input {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  padding: 3px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background-color: #ffffff;
  color: #0f172a;
}

.video-memo-hist-select {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 5px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background-color: #ffffff;
  color: #0f172a;
}

.video-memo-hist-actions {
  display: flex;
  justify-content: flex-end;
}

.video-memo-hist-save-btn {
  border: 1px solid #0284c7;
  background-color: #e0f2fe;
  color: #0369a1;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  cursor: pointer;
}

.video-memo-hist-save-btn:hover {
  background-color: #bae6fd;
}

.video-memo-hist-now-btn {
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #334155;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 6px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.video-memo-hist-now-btn:hover {
  background-color: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.video-studio-capture.is-capturing-png .video-memo-source-strip,
.video-studio-capture.is-capturing-png .video-memo-record-top,
.video-studio-capture.is-capturing-png .video-memo-history-box,
.video-studio-capture.is-capturing-png .video-memo-add-btn,
.video-studio-capture.is-capturing-png .video-memo-saved-badge,
.video-studio-capture.is-capturing-png .video-eval-reset-btn {
  display: none !important;
}

.video-studio-main-col {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}

.video-hero-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-height: 185px;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f8fafc, #eff6ff);
  border: 1.5px solid #0f172a;
  border-radius: 8px;
}

.video-hero-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
}

.video-hero-header .detail-avatar-wrap {
  width: 126px;
  height: 126px;
  flex-shrink: 0;
}

.video-hero-identity {
  flex: 1 1 auto;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.video-hero-name-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.video-hero-name {
  font-size: 32px;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
  line-height: 1.15;
}

.video-hero-style {
  font-size: 20px;
  font-weight: 800;
  color: #334155;
  line-height: 1.2;
}

.video-hero-meta-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.video-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 7px;
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
}

.video-hero-right-stack {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 9px;
  flex: 0 0 auto;
  min-width: 280px;
}

.video-hero-stats-box {
  display: grid;
  grid-template-columns: repeat(4, minmax(62px, 1fr));
  gap: 5px;
  padding: 7px 8px;
  background-color: #ffffff;
  border: 1.5px solid #94a3b8;
  border-radius: 8px;
  margin-left: 0;
  flex-shrink: 0;
}

@media (max-width: 780px) {
  .video-hero-header {
    flex-wrap: wrap;
  }
}

.video-stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 7px;
  border-radius: 6px;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  min-width: 58px;
}

.video-stat-lbl {
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  line-height: 1.15;
}

.video-stat-val {
  font-size: 19px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.25;
  white-space: nowrap;
}

.video-hero-tier-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffffff, #fffbeb);
  border: 3px solid #0f172a;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.2);
  flex-shrink: 0;
}

.video-tier-caption {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.4px;
}

.video-tier-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.video-tier-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 7px 26px;
  border-radius: 10px;
  font-family: var(--font-tier);
  font-size: 44px;
  font-weight: 900;
  border: 3px solid rgba(0, 0, 0, 0.4);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.26);
  line-height: 1.05;
}

.video-studio-capture.has-left-col .video-hero-header {
  padding: 12px;
  gap: 10px;
}

.video-studio-capture.has-left-col .video-hero-header .detail-avatar-wrap {
  width: 96px;
  height: 96px;
}

.video-studio-capture.has-left-col .video-hero-name {
  font-size: 25px;
}

.video-studio-capture.has-left-col .video-hero-style {
  font-size: 16.5px;
}

.video-studio-capture.has-left-col .video-meta-pill {
  font-size: 12.5px;
  padding: 3px 8px;
}

.video-studio-capture.has-left-col .video-hero-right-stack {
  min-width: 230px;
  gap: 7px;
}

.video-studio-capture.has-left-col .video-tier-chip {
  min-width: 88px;
  padding: 5px 18px;
  font-size: 36px;
}

.video-studio-capture.has-left-col .video-hero-stats-box {
  grid-template-columns: repeat(4, minmax(50px, 1fr));
  padding: 5px 6px;
}

.video-studio-capture.has-left-col .video-stat-chip {
  min-width: 46px;
  padding: 3px 5px;
}

.video-studio-capture.has-left-col .video-stat-lbl {
  font-size: 10.5px;
}

.video-studio-capture.has-left-col .video-stat-val {
  font-size: 16px;
}

.video-tier-arrow {
  font-size: 24px;
  font-weight: 900;
  color: #dc2626;
}

.video-tier-change-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  font-size: 11.5px;
  color: #475569;
  font-weight: 700;
}

.video-aptitude-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 10px;
}

.video-upper-stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

.video-upper-stage.has-scripts {
  grid-template-columns: minmax(0, 1.12fr) minmax(355px, 0.9fr);
}

.video-upper-left-col {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.video-middle-apt-col {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.85fr);
  gap: 8px;
  align-items: stretch;
}

@media (max-width: 980px) {
  .video-upper-stage.has-scripts {
    grid-template-columns: 1fr;
  }
  .video-middle-apt-col {
    grid-template-columns: 1fr;
  }
}

.video-section-card.is-compact-mid {
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.video-section-title.is-compact-mid {
  font-size: 12px;
  margin-bottom: 4px;
}

.video-upper-left-col .seal-matrix-table th,
.video-upper-left-col .seal-matrix-table td,
.video-upper-left-col .conquest-matrix-table th,
.video-upper-left-col .conquest-matrix-table td {
  font-size: 10px;
  padding: 3px 4px;
  word-break: keep-all;
  line-height: 1.25;
}

.video-upper-left-col .seal-matrix-table tbody th.seal-boss-header {
  font-size: 10px;
  padding: 3px 6px;
}

.video-upper-left-col .conquest-matrix-table th {
  width: 64%;
  padding: 4px 6px;
}

.video-upper-left-col .conquest-matrix-table td {
  width: 36%;
}

.video-upper-left-col .seal-matrix-table td span,
.video-upper-left-col .conquest-matrix-table td span {
  font-size: 12px;
  min-width: 20px;
  height: 18px;
  padding: 0 4px;
  border-radius: 4px;
}

.video-scripts-top3-card {
  background-color: #fffbeb;
  border-color: #d97706;
  justify-content: flex-start;
}

.video-scripts-top3-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  align-items: start;
  flex: 1;
}

.video-script-top3-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.video-script-rank-tag.is-top3-pill {
  font-size: 10.5px;
  padding: 1px 6px;
  width: 100%;
  text-align: center;
}

.video-script-top3-img {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 5 / 8;
  object-fit: cover;
  border-radius: 6px;
  border: 1.5px solid #f59e0b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  background-color: #e2e8f0;
  display: block;
}

.video-script-top3-fallback {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 5 / 8;
  border-radius: 6px;
  border: 1px dashed #cbd5e1;
  background-color: #ffffff;
  color: #475569;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.video-script-top3-name {
  width: 100%;
  font-size: 10.5px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
}

.video-script-skill-badges {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.video-skill-cond-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 9.5px;
  line-height: 1.25;
  padding: 3px 5px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  min-width: 0;
}

.video-skill-cond-row .vsc-head {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.video-skill-cond-row.is-active {
  background-color: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

.video-skill-cond-row.is-inactive {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: #64748b;
}

.video-skill-cond-row .vsc-slot {
  font-weight: 900;
  flex-shrink: 0;
}

.video-skill-cond-row .vsc-mark {
  font-weight: 900;
  flex-shrink: 0;
}

.video-skill-cond-row .vsc-cond {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-skill-cond-row .vsc-eff {
  font-size: 9.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  word-break: break-word;
}

.video-skill-cond-row .vsc-eff.is-muted {
  color: #94a3b8;
  font-weight: 600;
}

.video-script-top3-empty {
  color: #64748b;
  font-size: 12px;
  padding: 12px 4px;
  text-align: center;
}

.video-studio-capture .seal-matrix-table th,
.video-studio-capture .seal-matrix-table td,
.video-studio-capture .conquest-matrix-table th,
.video-studio-capture .conquest-matrix-table td {
  font-size: 10.5px;
  padding: 4px 3px;
  word-break: keep-all;
}

.video-section-card {
  border: 1.5px solid #1e293b;
  border-radius: 8px;
  padding: 12px 14px;
  background-color: #ffffff;
}

.video-section-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.video-eval-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-optional-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 780px) {
  .video-optional-grid {
    grid-template-columns: 1fr;
  }
}

.video-opt-card {
  border: 1.5px solid #94a3b8;
  border-radius: 8px;
  padding: 10px 12px;
  background-color: #f8fafc;
}

.video-opt-card.is-star4 {
  border-color: #38bdf8;
  background-color: #f0f9ff;
}

.video-opt-card.is-star5 {
  border-color: #f59e0b;
  background-color: #fffbeb;
}

.video-opt-card.is-scripts {
  grid-column: 1 / -1;
}

.video-opt-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 5px;
}

.video-opt-body {
  font-size: 13px;
  line-height: 1.6;
  color: #1e293b;
  white-space: pre-wrap;
}

.video-scripts-mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.video-script-mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #f59e0b;
  background-color: #ffffff;
  font-size: 12px;
}

.video-script-mini-chip img {
  width: 28px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
}

.video-script-mini-chip strong {
  display: block;
  color: #0f172a;
}

.video-script-mini-chip span {
  font-size: 11px;
  color: #475569;
}

@media (max-width: 768px) {
  .header-container {
    padding: 8px 0 0;
    gap: 8px 0;
  }
  .header-brand {
    order: 1;
    padding-left: 12px;
  }
  .brand-emblem {
    width: 31px;
    height: 31px;
    border-radius: 8px;
  }
  .brand-emblem span {
    font-size: 11px;
  }
  .brand-title {
    font-size: 18px;
  }
  .brand-subtitle {
    font-size: 10px;
    padding: 1px 7px;
  }
  .search-filter-bar {
    width: 100%;
    order: 3;
  }
  .header-actions {
    order: 2;
    margin-left: auto;
    padding-right: 12px;
    gap: 6px;
    flex-wrap: wrap;
  }
  .page-tabs-bar {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
  }
  .admin-actions-group {
    order: 4;
    flex: 0 0 100%;
    padding: 0 12px 8px;
  }
  .page-tabs-inner {
    padding: 7px 10px;
    gap: 6px;
    flex-wrap: wrap;
    overflow: visible;
  }
  .page-tab-btn {
    padding: 7px 11px;
    min-height: 36px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .nav-dropdown-menu {
    min-width: 215px;
    z-index: 3000;
  }
  #nav-group-tools .nav-dropdown-menu {
    left: auto;
    right: 0;
  }
  .tier-board-wrapper {
    padding: 10px 8px 24px;
    gap: 14px;
  }
  .tier-board-header {
    padding: 12px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .tbh-game-title {
    font-size: 18px;
  }
  .tbh-main-title {
    font-size: 20px;
  }
  .tbh-date {
    font-size: 17px;
  }
  .tbh-right {
    margin-left: 0;
    align-self: flex-start;
    text-align: left;
  }
  .tbh-condition,
  .tbh-criteria {
    font-size: 12px;
  }
  .tier-label-box {
    width: 50px;
    min-width: 50px;
    font-size: 20px;
    padding: 4px 2px;
  }
  .home-wrapper,
  .char-list-wrapper,
  .community-page-wrapper {
    padding: 12px 10px 28px;
  }
  .home-hero-card {
    padding: 16px 14px;
  }
  .home-hero-logo {
    width: 56px;
    height: 56px;
  }
  .home-nav-card {
    padding: 14px 15px;
    gap: 12px;
  }
  .home-nav-watermark {
    width: 175px;
    height: 108px;
    opacity: 0.19;
    right: 2px;
    bottom: -8px;
  }
  .home-nav-icon {
    width: 46px;
    height: 46px;
    font-size: 26px;
  }
  .char-list-container,
  .community-page-container {
    padding: 14px 12px;
  }
  .char-list-filter-bar {
    padding: 8px 10px;
    gap: 6px;
  }
  .char-list-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .char-list-controls {
    justify-content: space-between;
  }
  .char-list-sort-group {
    flex: 1 1 auto;
    flex-wrap: wrap;
  }
  .modal-overlay {
    padding: 8px;
  }
  .modal-dialog {
    padding: 16px 14px;
    max-height: 92vh;
  }
  .detail-modal-dialog {
    padding: 46px 12px 16px;
  }
  .detail-sticky-close-bar {
    top: 6px;
    margin-top: -36px;
    margin-bottom: 36px;
  }
  .detail-avatar-name-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .perf-meta-table {
    display: block;
    overflow-x: auto;
    font-size: 12.5px;
  }
  .footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   Seal Battle Score Calculator Page
   ============================================================ */
.home-nav-card.sealcalc-card:hover {
  border-color: #f59e0b;
}
.home-nav-card.sealcalc-card .home-nav-cta {
  color: #b45309;
}

.seal-bonus-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  background-color: #f4f9ff;
  border: 1px solid #c5dcf3;
  border-radius: 10px;
  margin-bottom: 18px;
}

.seal-bonus-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.seal-bonus-label {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.seal-bonus-current {
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  padding: 2px 10px;
  border-radius: 999px;
}

.seal-bonus-toggle-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.seal-bonus-btn {
  padding: 7px 14px;
  border-radius: 7px;
  border: 1px solid #b8d1eb;
  background-color: #ffffff;
  color: #1e293b;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.seal-bonus-btn:hover {
  border-color: #f59e0b;
  color: #92400e;
  background-color: #fffbeb;
}

.seal-bonus-btn.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #b45309;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.seal-calc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

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

.seal-calc-card {
  background-color: #f8fbff;
  border: 1px solid #c5dcf3;
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.seal-calc-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.seal-calc-card-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.seal-calc-pattern-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 800;
  background-color: #e0f2fe;
  border: 1px solid #7dd3fc;
  color: #0369a1;
}

.seal-calc-pattern-badge.is-reverse {
  background-color: #f3e8ff;
  border-color: #d8b4fe;
  color: #6b21a8;
}

.seal-calc-desc {
  font-size: 13px;
  color: #475569;
  margin: 0;
}

.seal-time-input-row,
.seal-score-input-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.seal-time-unit-box {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.seal-time-input,
.seal-score-input {
  background-color: #ffffff;
  border: 1px solid #b8d1eb;
  border-radius: 7px;
  color: #0f172a;
  font-size: 20px;
  font-weight: 800;
  padding: 8px 10px;
  text-align: center;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.seal-time-input {
  width: 48px;
}

.seal-time-input.is-wide {
  width: 60px;
}

.seal-score-input {
  width: 190px;
  text-align: right;
  padding-right: 12px;
}

.seal-time-input:focus,
.seal-score-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
}

.seal-time-input::placeholder,
.seal-score-input::placeholder {
  color: rgba(71, 85, 105, 0.45);
  font-weight: 700;
}

.seal-time-unit,
.seal-score-unit {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}

.seal-time-unit-sub {
  font-size: 11.5px;
  color: #475569;
}

.seal-clear-btn {
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid #b8d1eb;
  background-color: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.seal-clear-btn:hover {
  background-color: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.seal-preset-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.seal-preset-label {
  font-size: 12px;
  color: #475569;
  font-weight: 700;
}

.seal-preset-btn {
  padding: 3px 9px;
  border-radius: 5px;
  border: 1px solid #b8d1eb;
  background-color: #ffffff;
  color: #1e3a5f;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.seal-preset-btn:hover {
  border-color: #2563eb;
  background-color: #eff6ff;
  color: #1d4ed8;
}

.seal-range-hint {
  font-size: 12px;
  color: #475569;
}

.seal-calc-warn {
  font-size: 12.5px;
  font-weight: 700;
  color: #b91c1c;
  background-color: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 7px 10px;
}

.seal-result-box {
  margin-top: auto;
  background: linear-gradient(135deg, #e0f2fe, #eff6ff);
  border: 1px solid #7dd3fc;
  border-radius: 8px;
  padding: 14px;
}

.seal-result-box.is-reverse {
  background: linear-gradient(135deg, #f3e8ff, #eef2ff);
  border-color: #c4b5fd;
}

.seal-result-label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.seal-result-main {
  font-size: 26px;
  font-weight: 900;
  color: #0c4a6e;
  letter-spacing: 0.3px;
  line-height: 1.25;
}

.seal-result-box.is-reverse .seal-result-main {
  color: #5b21b6;
}

.seal-result-sub {
  font-size: 12.5px;
  color: #1e293b;
  margin-top: 6px;
}

.seal-result-breakdown {
  font-size: 12px;
  color: #475569;
  margin-top: 4px;
}

.seal-formula-note-box {
  background-color: #f2f7fe;
  border: 1px solid #c5dcf3;
  border-radius: 8px;
  padding: 14px 16px;
}

.seal-formula-note-box h4 {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px 0;
}

.seal-formula-note-box ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.seal-formula-note-box code {
  background-color: #e0edff;
  color: #1e40af;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* ============================================================
   Theme Toggle Button & Deep Navy Dark Mode (Default)
   ============================================================ */
.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: #ffffff;
  color: #1e3a8a;
  border: 1px solid #93c5fd;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.btn-theme-toggle:hover {
  background-color: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.btn-theme-toggle .theme-toggle-icon {
  font-size: 13px;
  line-height: 1;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-dark: #091124;
  --bg-card: #101c36;
  --bg-panel: #162544;
  --tier-row-bg: #13203d;
  --tier-row-border: #283b64;
  --text-main: #e8effd;
  --text-muted: #9db2d9;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
}

html[data-theme="dark"] body {
  background-color: var(--bg-dark);
  background-image: radial-gradient(circle at 18% -8%, rgba(37, 99, 235, 0.16), transparent 44%),
    radial-gradient(circle at 86% 6%, rgba(14, 165, 233, 0.1), transparent 36%);
  color: var(--text-main);
}

/* Header & Navigation */
html[data-theme="dark"] .app-header {
  background: linear-gradient(135deg, #0b152c 0%, #101f3f 56%, #14274f 100%);
  border-bottom-color: #243963;
  box-shadow: 0 6px 24px rgba(2, 6, 23, 0.52);
}

html[data-theme="dark"] .header-brand:hover {
  background-color: rgba(59, 130, 246, 0.16);
}

html[data-theme="dark"] .brand-title {
  background: linear-gradient(95deg, #f8fafc 0%, #93c5fd 55%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 4px rgba(56, 189, 248, 0.25));
}

html[data-theme="dark"] .brand-subtitle {
  color: #bae6fd;
  background: #172b52;
  border-color: #2f518f;
}

html[data-theme="dark"] .btn-theme-toggle {
  background: linear-gradient(135deg, #16284c, #1d3563);
  color: #e2ecff;
  border-color: #3b5c99;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.35);
}

html[data-theme="dark"] .btn-theme-toggle:hover {
  background: linear-gradient(135deg, #1d3563, #264580);
  border-color: #60a5fa;
  color: #ffffff;
}

html[data-theme="dark"] .page-tabs-bar {
  background: #0d1832;
  border-top-color: #1f3258;
}

html[data-theme="dark"] .page-tab-btn {
  background-color: #132242;
  border-color: #273e6c;
  color: #dbe7ff;
}

html[data-theme="dark"] .page-tab-btn:hover {
  background-color: #1c315c;
  border-color: #4f78c4;
  color: #ffffff;
}

html[data-theme="dark"] .page-tab-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #60a5fa;
  color: #ffffff;
}

html[data-theme="dark"] .nav-dropdown-menu {
  background-color: #101e3b;
  border-color: #2a4170;
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.65);
}

html[data-theme="dark"] .nav-dropdown-item {
  color: #dce7fc;
}

html[data-theme="dark"] .nav-dropdown-item:hover {
  background-color: #1b2f58;
  color: #93c5fd;
}

html[data-theme="dark"] .nav-soon-tag,
html[data-theme="dark"] .home-nav-badge.is-soon,
html[data-theme="dark"] .planned-status-pill {
  background-color: #18294d;
  border-color: #314b80;
  color: #a9bde3;
}

/* Search, Filters & Common Controls */
html[data-theme="dark"] .search-box input,
html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .btn-filter-reset,
html[data-theme="dark"] .multi-dropdown-btn,
html[data-theme="dark"] .filter-overview-close-btn,
html[data-theme="dark"] .filter-overview-option,
html[data-theme="dark"] .btn-outline,
html[data-theme="dark"] .btn-auth,
html[data-theme="dark"] .detail-rec-sort-select,
html[data-theme="dark"] .detail-rec-mode-btn,
html[data-theme="dark"] .detail-rec-view-btn,
html[data-theme="dark"] .char-rec-rank-select,
html[data-theme="dark"] .char-rec-order-btn,
html[data-theme="dark"] .seal-score-input {
  background-color: #0e1a34;
  border-color: #2a406e;
  color: #e4ecfc;
}

html[data-theme="dark"] .search-box input::placeholder,
html[data-theme="dark"] .clear-btn {
  color: #88a0ca;
}

html[data-theme="dark"] .filter-select.active-filter,
html[data-theme="dark"] .multi-dropdown-btn.is-open,
html[data-theme="dark"] .filter-overview-option.is-checked {
  background-color: #1d3768;
  border-color: #60a5fa;
  color: #dbeafe;
}

html[data-theme="dark"] .btn-filter-reset:hover,
html[data-theme="dark"] .multi-dropdown-btn:hover,
html[data-theme="dark"] .filter-overview-close-btn:hover,
html[data-theme="dark"] .filter-overview-option:hover,
html[data-theme="dark"] .btn-outline:hover,
html[data-theme="dark"] .btn-auth:hover,
html[data-theme="dark"] .detail-rec-mode-btn:hover,
html[data-theme="dark"] .char-rec-order-btn:hover:not(:disabled) {
  background-color: #1a2e56;
  border-color: #4c78c9;
  color: #ffffff;
}

html[data-theme="dark"] .btn-secondary {
  background-color: #1b2e55;
  border-color: #2f497d;
  color: #e2ecff;
}

html[data-theme="dark"] .btn-secondary:hover {
  background-color: #243d70;
}

html[data-theme="dark"] .mode-badge.view-mode {
  background-color: #152b54;
  color: #93c5fd;
  border: 1px solid #2b4d8a;
}

html[data-theme="dark"] .mode-badge.admin-mode {
  background-color: #3f1822;
  color: #fecaca;
  border: 1px solid #7f293b;
}

html[data-theme="dark"] .mode-badge.editor-mode {
  background-color: #113328;
  color: #bbf7d0;
  border: 1px solid #1e634b;
}

html[data-theme="dark"] .filter-overview-panel {
  background-color: #101e3b;
  border-color: #2b4375;
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.65);
}

html[data-theme="dark"] .filter-overview-header {
  border-bottom-color: #223661;
}

html[data-theme="dark"] .filter-overview-title-group {
  color: #f1f5f9;
}

html[data-theme="dark"] .filter-overview-count {
  background-color: #1e3a6e;
  color: #bae6fd;
}

html[data-theme="dark"] .filter-overview-empty,
html[data-theme="dark"] .filter-overview-group-count {
  color: #93a9d1;
}

/* Home Hub */
html[data-theme="dark"] .home-hero-card,
html[data-theme="dark"] .home-nav-card,
html[data-theme="dark"] .home-panel {
  background-color: var(--bg-card);
  border-color: #233862;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.42);
}

html[data-theme="dark"] .home-hero-card {
  background: linear-gradient(135deg, #101e3b 0%, #14254a 55%, #172c57 100%);
}

html[data-theme="dark"] .home-game-pill {
  background-color: #1b3260;
  border-color: #35589c;
  color: #bae6fd;
}

html[data-theme="dark"] .home-date-pill {
  background-color: #0e1a33;
  border-color: #263d6a;
  color: #a7bce0;
}

html[data-theme="dark"] .home-hero-title {
  color: #f8fbff;
}

html[data-theme="dark"] .home-hero-desc {
  color: #c7d6f2;
}

html[data-theme="dark"] .home-stat-box {
  background-color: #0d1831;
  border-color: #233862;
}

html[data-theme="dark"] .home-stat-lbl {
  color: #97add6;
}

html[data-theme="dark"] .home-nav-section-head {
  color: #9ec0f5;
}

html[data-theme="dark"] .home-nav-card:hover {
  background-color: #15264a;
  border-color: #4f7ad1;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.55);
}

html[data-theme="dark"] .home-nav-icon {
  background-color: #172a52;
  border-color: #2d477d;
}

html[data-theme="dark"] .home-nav-title-row h3,
html[data-theme="dark"] .home-panel-header h3,
html[data-theme="dark"] .home-recent-char-name,
html[data-theme="dark"] .home-profile-name {
  color: #eff5ff;
}

html[data-theme="dark"] .home-nav-body p,
html[data-theme="dark"] .home-recent-char-sub,
html[data-theme="dark"] .home-profile-empty,
html[data-theme="dark"] .home-profile-bio,
html[data-theme="dark"] .author-bio-mini {
  color: #a6bae0;
}

html[data-theme="dark"] .home-nav-badge {
  background-color: #1a2f59;
  border-color: #32508c;
  color: #bfdbfe;
}

html[data-theme="dark"] .home-recent-char-item,
html[data-theme="dark"] .home-history-row {
  background-color: #0e1932;
  border-color: #223660;
}

html[data-theme="dark"] .home-recent-char-item:hover,
html[data-theme="dark"] .home-history-row.clickable:hover {
  background-color: #172a52;
  border-color: #436bb8;
}

html[data-theme="dark"] .home-recent-char-thumb {
  background-color: #182a50;
  color: #cbd5e1;
}

html[data-theme="dark"] .home-profile-ach-list li,
html[data-theme="dark"] .profile-ach-chip {
  background-color: #15274b;
  border-color: #2c467a;
  color: #dbeafe;
}

html[data-theme="dark"] .profile-copy-id-btn {
  background-color: #172a50;
  border-color: #2f4b82;
  color: #bfdbfe;
}

html[data-theme="dark"] .wm-frame,
html[data-theme="dark"] .wm-fb-textarea {
  background-color: rgba(11, 21, 44, 0.85);
  border-color: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

html[data-theme="dark"] .wm-tier-lbl,
html[data-theme="dark"] .wm-pill,
html[data-theme="dark"] .wm-calc-pill,
html[data-theme="dark"] .wm-calc-num {
  background-color: rgba(23, 41, 79, 0.9);
  border-color: rgba(71, 108, 179, 0.45);
  color: #cbd5e1;
}

html[data-theme="dark"] .wm-char-art::after {
  background: linear-gradient(180deg, transparent, rgba(16, 28, 54, 0.9));
}

/* Tier Board & Right Sidebar */
html[data-theme="dark"] .tier-board-container,
html[data-theme="dark"] .tier-board-header,
html[data-theme="dark"] .author-card,
html[data-theme="dark"] .history-sidebar,
html[data-theme="dark"] .unassigned-cards {
  background-color: var(--bg-card);
  border-color: #233862;
}

html[data-theme="dark"] .tier-board-header,
html[data-theme="dark"] .author-header,
html[data-theme="dark"] .history-header {
  background-color: #142446;
  border-bottom-color: #243963;
}

html[data-theme="dark"] .author-title-group h3,
html[data-theme="dark"] .history-title-group h3,
html[data-theme="dark"] .tier-video-mode-info strong,
html[data-theme="dark"] .unassigned-header h3,
html[data-theme="dark"] .history-target,
html[data-theme="dark"] .home-author-sns-title {
  color: #edf4ff;
}

html[data-theme="dark"] .tier-video-mode-bar {
  background-color: #11203f;
  border-color: #253b68;
  color: #dbe7ff;
}

html[data-theme="dark"] .tier-video-mode-sub,
html[data-theme="dark"] .unassigned-hint,
html[data-theme="dark"] .author-empty-hint,
html[data-theme="dark"] .history-empty,
html[data-theme="dark"] .history-time,
html[data-theme="dark"] .history-del-btn {
  color: #93aad4;
}

html[data-theme="dark"] .tier-video-mode-btn,
html[data-theme="dark"] .history-mini-btn {
  background-color: #0e1a34;
  border-color: #2a406e;
  color: #dce8ff;
}

html[data-theme="dark"] .tier-video-mode-btn:hover,
html[data-theme="dark"] .history-mini-btn:hover {
  background-color: #1b315d;
  border-color: #4e7ad1;
  color: #ffffff;
}

html[data-theme="dark"] .tier-video-mode-btn.is-active {
  background-color: #103229;
  border-color: #10b981;
  color: #a7f3d0;
}

html[data-theme="dark"] .tier-nohist-mode-bar.is-active {
  background: linear-gradient(90deg, #33250b, #231b0b);
  border-color: #b45309;
}

html[data-theme="dark"] .tier-nohist-mode-btn.is-active {
  background-color: #3f2b0d;
  border-color: #f59e0b;
  color: #fde68a;
}

html[data-theme="dark"] .tier-row {
  background-color: var(--tier-row-bg);
  border-color: var(--tier-row-border);
}

html[data-theme="dark"] .tier-label-tooltip {
  background: linear-gradient(135deg, #0f1d3a, #172b54);
  border-color: #3b5998;
  color: #eef4ff;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.72);
}

html[data-theme="dark"] .tier-tip-title {
  color: #93c5fd;
}

html[data-theme="dark"] .tier-tip-body {
  color: #dce7fc;
}

html[data-theme="dark"] .unassigned-pool {
  background-color: #122140;
  border-color: #263d6b;
}

html[data-theme="dark"] .history-item {
  background-color: #0d1831;
  border-color: #21345c;
}

html[data-theme="dark"] .history-item.clickable:hover {
  background-color: #162950;
  border-color: #466ec0;
}

html[data-theme="dark"] .history-detail {
  color: #b8cae8;
}

html[data-theme="dark"] .sns-link-btn.youtube {
  background-color: #351621;
  border-color: #7c243a;
  color: #fecdd3;
}

html[data-theme="dark"] .sns-link-btn.x-twitter {
  background-color: #132240;
  border-color: #2e487a;
  color: #e2ecff;
}

html[data-theme="dark"] .sns-link-btn.x-twitter .sns-icon-svg {
  color: #e2ecff;
}

html[data-theme="dark"] .sns-link-btn.official {
  background-color: #13294d;
  border-color: #2f5596;
  color: #bae6fd;
}

html[data-theme="dark"] .sns-link-btn.official:hover {
  background-color: #1a3766;
}

html[data-theme="dark"] .sns-link-btn.discord {
  background-color: #1d224b;
  border-color: #434c99;
  color: #c7d2fe;
}

/* Character List & Scripts Catalog */
html[data-theme="dark"] .char-list-container,
html[data-theme="dark"] .char-list-card,
html[data-theme="dark"] .char-list-simple-row,
html[data-theme="dark"] .script-card,
html[data-theme="dark"] .script-simple-row,
html[data-theme="dark"] .script-preview-card,
html[data-theme="dark"] .char-preview-card {
  background-color: var(--bg-card);
  border-color: #233862;
}

html[data-theme="dark"] .char-list-filter-bar {
  background-color: #122140;
  border-color: #253b68;
}

html[data-theme="dark"] .char-list-card:hover,
html[data-theme="dark"] .char-list-simple-row:hover,
html[data-theme="dark"] .script-card:hover,
html[data-theme="dark"] .script-simple-row:hover {
  background-color: #16284d;
  border-color: #4a75c9;
}

html[data-theme="dark"] .char-list-card-media,
html[data-theme="dark"] .char-list-simple-thumb,
html[data-theme="dark"] .script-card-media,
html[data-theme="dark"] .script-simple-thumb,
html[data-theme="dark"] .script-card-placeholder {
  background-color: #0b152c;
}

html[data-theme="dark"] .char-list-card-name,
html[data-theme="dark"] .char-list-simple-name,
html[data-theme="dark"] .script-card-name,
html[data-theme="dark"] .script-detail-title-row h2,
html[data-theme="dark"] .script-matched-chars-title,
html[data-theme="dark"] .script-matched-char-name {
  color: #eef5ff;
}

html[data-theme="dark"] .char-list-card-fallback span,
html[data-theme="dark"] .char-list-empty,
html[data-theme="dark"] .script-card-date,
html[data-theme="dark"] .script-simple-skills,
html[data-theme="dark"] .script-matched-chars-sub,
html[data-theme="dark"] .script-matched-chars-empty,
html[data-theme="dark"] .script-matched-char-meta {
  color: #9cb2d9;
}

html[data-theme="dark"] .char-list-icon-chip,
html[data-theme="dark"] .role-inline-icon,
html[data-theme="dark"] .script-role-pill,
html[data-theme="dark"] .script-date-pill,
html[data-theme="dark"] .char-list-metric-pill,
html[data-theme="dark"] .script-card-stats-mini,
html[data-theme="dark"] .script-card-effects {
  background-color: #142446;
  border-color: #294170;
  color: #d6e4fd;
}

html[data-theme="dark"] .char-list-metric-pill.is-secondary {
  background-color: #0e1a33;
  color: #a9bde2;
}

html[data-theme="dark"] .char-list-simple-metric,
html[data-theme="dark"] .script-card-stats-mini span strong {
  color: #e8f0ff;
}

html[data-theme="dark"] .script-eff-line,
html[data-theme="dark"] .script-detail-effect-body {
  color: #d5e2fb;
}

html[data-theme="dark"] .script-eff-tag {
  background-color: #1b315c;
  border-color: #365796;
  color: #cfe1ff;
}

html[data-theme="dark"] .script-matched-chars-sidebar,
html[data-theme="dark"] .script-detail-effect-card,
html[data-theme="dark"] .script-detail-info-col,
html[data-theme="dark"] .script-detail-gacha-quickbar {
  background-color: #132242;
  border-color: #283f6e;
}

html[data-theme="dark"] .script-matched-char-btn,
html[data-theme="dark"] .script-gacha-quick-btn,
html[data-theme="dark"] .script-lv-switch,
html[data-theme="dark"] .script-lv-btn,
html[data-theme="dark"] .script-quick-num,
html[data-theme="dark"] .script-s3-advanced-details {
  background-color: #0d1932;
  border-color: #294170;
  color: #dce8ff;
}

html[data-theme="dark"] .script-matched-char-btn:hover,
html[data-theme="dark"] .script-quick-num:hover {
  background-color: #1b305c;
  border-color: #5380d6;
}

html[data-theme="dark"] .script-matched-char-thumb {
  background-color: #182a50;
  color: #cbd5e1;
}

html[data-theme="dark"] .script-quick-label,
html[data-theme="dark"] .script-s3-advanced-details summary {
  color: #b7cae9;
}

/* Modals, Character Detail & Forms */
html[data-theme="dark"] .modal-dialog,
html[data-theme="dark"] .detail-modal-dialog,
html[data-theme="dark"] .char-form-sticky-header,
html[data-theme="dark"] .detail-sticky-close-bar,
html[data-theme="dark"] .detail-evaluation-box {
  background-color: var(--bg-card);
  border-color: #263d6c;
  color: var(--text-main);
}

html[data-theme="dark"] .char-form-sticky-header,
html[data-theme="dark"] .detail-sticky-close-bar,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
  border-color: #223661;
}

html[data-theme="dark"] .char-form-sticky-header h3,
html[data-theme="dark"] .modal-header h3,
html[data-theme="dark"] .form-section-title,
html[data-theme="dark"] .perf-sub-title,
html[data-theme="dark"] .perf-ability-name,
html[data-theme="dark"] .trait-unlock-toggle,
html[data-theme="dark"] .perm-check-card strong,
html[data-theme="dark"] .manage-box h4,
html[data-theme="dark"] .batch-preview-header h4,
html[data-theme="dark"] .drop-text {
  color: #eff5ff;
}

html[data-theme="dark"] .modal-subtitle,
html[data-theme="dark"] .form-hint,
html[data-theme="dark"] .perf-stat-label,
html[data-theme="dark"] .manage-box p,
html[data-theme="dark"] .perm-check-card span,
html[data-theme="dark"] .drop-subtext,
html[data-theme="dark"] .modal-close-btn,
html[data-theme="dark"] .char-form-close-inline {
  color: #9cb2d9;
}

html[data-theme="dark"] .modal-close-btn:hover,
html[data-theme="dark"] .char-form-close-inline:hover {
  background-color: #1c315b;
  color: #ffffff;
}

html[data-theme="dark"] #script-detail-modal .modal-swipe-handle {
  background: rgba(148, 179, 232, 0.45);
}

html[data-theme="dark"] .detail-awakened-box,
html[data-theme="dark"] .detail-awakened-empty,
html[data-theme="dark"] .detail-performance-box,
html[data-theme="dark"] .trait-unlock-editor-box,
html[data-theme="dark"] .char-awakened-preview-box,
html[data-theme="dark"] .manage-box,
html[data-theme="dark"] .perm-check-card,
html[data-theme="dark"] .form-section.perm-locked,
html[data-theme="dark"] .batch-options-card,
html[data-theme="dark"] .batch-drop-zone,
html[data-theme="dark"] .batch-preview-container,
html[data-theme="dark"] .detail-rec-scripts-box,
html[data-theme="dark"] .detail-tier-history-details {
  background-color: #132242;
  border-color: #273e6c;
}

html[data-theme="dark"] .perf-meta-table,
html[data-theme="dark"] .perf-stats-grid,
html[data-theme="dark"] .perf-ability-card,
html[data-theme="dark"] .batch-preview-item,
html[data-theme="dark"] .char-rec-simple-row,
html[data-theme="dark"] .char-rec-script-card,
html[data-theme="dark"] .detail-tier-history-list li {
  background-color: #0e1a34;
  border-color: #243963;
}

html[data-theme="dark"] .perf-meta-table th,
html[data-theme="dark"] .seal-matrix-table th,
html[data-theme="dark"] .matrix-edit-table th {
  background-color: #192d55;
  border-color: #2d4678;
  color: #e6efff;
}

html[data-theme="dark"] .perf-meta-table td,
html[data-theme="dark"] .seal-matrix-table td,
html[data-theme="dark"] .matrix-edit-table td {
  border-color: #233862;
  color: #dce8ff;
}

html[data-theme="dark"] .perf-ability-desc,
html[data-theme="dark"] .form-group label,
html[data-theme="dark"] .checkbox-label,
html[data-theme="dark"] .char-rec-simple-effects,
html[data-theme="dark"] .char-rec-script-effects,
html[data-theme="dark"] .detail-tier-change-meta,
html[data-theme="dark"] .detail-tier-history-details summary {
  color: #cbd8f2;
}

html[data-theme="dark"] .perf-ability-note {
  background-color: #15284c;
  border-color: #2c4a82;
  color: #cbd8f2;
}

html[data-theme="dark"] .perf-ability-note strong {
  color: #93c5fd;
}

html[data-theme="dark"] .perf-trait-unlock {
  background-color: #2b2612;
  border-color: #7c651d;
  color: #fef3c7;
}

html[data-theme="dark"] .perf-trait-unlock.star5 {
  background-color: #351822;
  border-color: #7f293c;
  color: #ffe4e6;
}

html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .trait-large-textarea,
html[data-theme="dark"] .matrix-edit-table select,
html[data-theme="dark"] #char-text-import-input {
  background-color: #0b162e;
  border-color: #2b4475;
  color: #e8f0ff;
}

html[data-theme="dark"] .text-import-card {
  background-color: #122447;
  border-color: #2b4a85;
}

html[data-theme="dark"] .text-import-header {
  background-color: #18305e;
  border-bottom-color: #2e5191;
}

html[data-theme="dark"] .text-import-title,
html[data-theme="dark"] .text-import-chevron {
  color: #bfdbfe;
}

html[data-theme="dark"] .detail-rec-count,
html[data-theme="dark"] .detail-tier-reason-pill,
html[data-theme="dark"] .detail-tier-history-list .th-reason {
  background-color: #182b52;
  border-color: #2f4b82;
  color: #cfe0ff;
}

html[data-theme="dark"] .char-rec-simple-row:hover,
html[data-theme="dark"] .char-rec-script-card:hover {
  background-color: #15274d;
  border-color: #4f7ad1;
}

html[data-theme="dark"] .char-rec-simple-name,
html[data-theme="dark"] .char-rec-script-name {
  color: #eef5ff;
}

html[data-theme="dark"] .char-rec-simple-atk {
  color: #9eb4dc;
}

html[data-theme="dark"] .char-rec-match-pill.is-both {
  background-color: #133b2e;
  border-color: #10b981;
  color: #a7f3d0;
}

html[data-theme="dark"] .char-rec-match-pill.is-s2 {
  background-color: #16335c;
  border-color: #3b82f6;
  color: #bae6fd;
}

html[data-theme="dark"] .char-rec-match-pill.is-s3 {
  background-color: #2d1e54;
  border-color: #8b5cf6;
  color: #ddd6fe;
}

html[data-theme="dark"] .char-rec-match-pill.is-none {
  background-color: #1b2845;
  border-color: #364b78;
  color: #9fb3d6;
}

html[data-theme="dark"] .char-rec-editor-bar {
  background-color: #182a4d;
  border-color: #2f4b82;
}

html[data-theme="dark"] .char-rec-priority-hint {
  color: #fde68a;
  background-color: #3a2b10;
  border-color: #85601a;
}

html[data-theme="dark"] .manage-box.danger-box {
  background-color: #311520;
  border-color: #70263b;
}

html[data-theme="dark"] .toast {
  background-color: #1a2d55;
  border: 1px solid #3c62ab;
  color: #f8fbff;
}

/* Video Studio & Memos */
html[data-theme="dark"] .video-studio-controls,
html[data-theme="dark"] .video-studio-capture,
html[data-theme="dark"] .video-studio-memo-col {
  background-color: var(--bg-card);
  border-color: #253b68;
}

html[data-theme="dark"] .video-section-card,
html[data-theme="dark"] .video-left-subcard,
html[data-theme="dark"] .video-opt-card,
html[data-theme="dark"] .video-memo-record-card,
html[data-theme="dark"] .video-hero-header,
html[data-theme="dark"] .video-hero-stats-box,
html[data-theme="dark"] .video-hero-tier-box {
  background-color: #122142;
  border-color: #284070;
}

html[data-theme="dark"] .video-studio-title,
html[data-theme="dark"] .video-ctrl-label,
html[data-theme="dark"] .video-hero-name,
html[data-theme="dark"] .video-stat-val,
html[data-theme="dark"] .video-section-title,
html[data-theme="dark"] .video-opt-title,
html[data-theme="dark"] .video-left-subtitle,
html[data-theme="dark"] .video-script-top3-name {
  color: #eef5ff;
}

html[data-theme="dark"] .video-hero-style,
html[data-theme="dark"] .video-stat-lbl,
html[data-theme="dark"] .video-tier-caption,
html[data-theme="dark"] .video-tier-change-note,
html[data-theme="dark"] .video-opt-body,
html[data-theme="dark"] .video-left-subbody,
html[data-theme="dark"] .video-memo-record-date,
html[data-theme="dark"] .video-script-top3-empty {
  color: #b4c6e7;
}

html[data-theme="dark"] .video-check-pill,
html[data-theme="dark"] .video-meta-pill,
html[data-theme="dark"] .video-stat-chip,
html[data-theme="dark"] .video-memo-radio-pill,
html[data-theme="dark"] .video-script-mini-chip,
html[data-theme="dark"] .video-skill-cond-row {
  background-color: #0d1932;
  border-color: #294170;
  color: #dce8ff;
}

html[data-theme="dark"] .video-skill-cond-row.is-active {
  background-color: #123329;
  border-color: #1f6b53;
}

html[data-theme="dark"] .video-skill-cond-row.is-inactive {
  background-color: #141f38;
  border-color: #2a3a5e;
  color: #8ea3c9;
}

html[data-theme="dark"] .video-reason-quick-input,
html[data-theme="dark"] .video-ctrl-memo-textarea,
html[data-theme="dark"] .video-memo-title-input,
html[data-theme="dark"] .video-memo-hist-date-input,
html[data-theme="dark"] .video-memo-hist-select {
  background-color: #0a1429;
  border-color: #2c4678;
  color: #e8f0ff;
}

/* Community Pages (Q&A, Feedback, Planned Pages) & Footer */
html[data-theme="dark"] .community-page-container,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .feedback-card,
html[data-theme="dark"] .feedback-log-item,
html[data-theme="dark"] .planned-page-card,
html[data-theme="dark"] .site-footer {
  background-color: var(--bg-card);
  border-color: #243963;
}

html[data-theme="dark"] .community-title-block h2,
html[data-theme="dark"] .faq-q-text,
html[data-theme="dark"] .feedback-card-title,
html[data-theme="dark"] .feedback-label,
html[data-theme="dark"] .planned-page-card h3,
html[data-theme="dark"] .footer-disclaimer-title {
  color: #eff5ff;
}

html[data-theme="dark"] .community-subtitle,
html[data-theme="dark"] .faq-answer-body,
html[data-theme="dark"] .faq-chevron,
html[data-theme="dark"] .feedback-log-note,
html[data-theme="dark"] .feedback-log-meta,
html[data-theme="dark"] .feedback-log-body,
html[data-theme="dark"] .planned-feature-list,
html[data-theme="dark"] .footer-disclaimer-list,
html[data-theme="dark"] .footer-copyright {
  color: #a9bee3;
}

html[data-theme="dark"] .faq-question-btn,
html[data-theme="dark"] .faq-answer-panel,
html[data-theme="dark"] .feedback-cat-pill,
html[data-theme="dark"] .footer-disclaimer-box,
html[data-theme="dark"] .footer-auth-btn {
  background-color: #132242;
  border-color: #283f6e;
  color: #dce8ff;
}

html[data-theme="dark"] .faq-question-btn:hover,
html[data-theme="dark"] .feedback-cat-pill:hover,
html[data-theme="dark"] .footer-auth-btn:hover {
  background-color: #1b315d;
  border-color: #4f7ad1;
}

html[data-theme="dark"] .feedback-textarea {
  background-color: #0b162e;
  border-color: #2c4678;
  color: #e8f0ff;
}

html[data-theme="dark"] .feedback-notice-banner {
  background-color: #13264d;
  border-color: #2e5094;
  color: #cfe0ff;
}

html[data-theme="dark"] .footer-text-link {
  color: #93c5fd;
}

html[data-theme="dark"] .footer-disclaimer-list strong {
  color: #e2ecff;
}

/* Seal Battle Calculator Page */
html[data-theme="dark"] .seal-bonus-bar,
html[data-theme="dark"] .seal-calc-card,
html[data-theme="dark"] .seal-formula-note-box {
  background-color: var(--bg-card);
  border-color: #243963;
}

html[data-theme="dark"] .seal-bonus-label,
html[data-theme="dark"] .seal-calc-card-header h3,
html[data-theme="dark"] .seal-formula-note-box h4,
html[data-theme="dark"] .seal-result-main {
  color: #eff5ff;
}

html[data-theme="dark"] .seal-bonus-current,
html[data-theme="dark"] .seal-calc-desc,
html[data-theme="dark"] .seal-score-unit,
html[data-theme="dark"] .seal-time-unit-sub,
html[data-theme="dark"] .seal-preset-label,
html[data-theme="dark"] .seal-range-hint,
html[data-theme="dark"] .seal-result-label,
html[data-theme="dark"] .seal-result-sub,
html[data-theme="dark"] .seal-result-breakdown,
html[data-theme="dark"] .seal-formula-note-box ul {
  color: #aec2e6;
}

html[data-theme="dark"] .seal-bonus-btn,
html[data-theme="dark"] .seal-preset-btn,
html[data-theme="dark"] .seal-clear-btn {
  background-color: #132242;
  border-color: #294170;
  color: #dbe8ff;
}

html[data-theme="dark"] .seal-bonus-btn:hover,
html[data-theme="dark"] .seal-preset-btn:hover,
html[data-theme="dark"] .seal-clear-btn:hover {
  background-color: #1c325e;
  border-color: #5380d6;
}

html[data-theme="dark"] .seal-bonus-btn.active {
  background-color: #2563eb;
  border-color: #60a5fa;
  color: #ffffff;
}

html[data-theme="dark"] .seal-result-box {
  background: linear-gradient(135deg, #10284d, #132d59);
  border-color: #3567b5;
}

html[data-theme="dark"] .seal-result-box.is-reverse {
  background: linear-gradient(135deg, #221a4d, #1b2254);
  border-color: #6d4ec4;
}

html[data-theme="dark"] .seal-result-box.is-reverse .seal-result-main {
  color: #ddd6fe;
}

html[data-theme="dark"] .seal-calc-warn {
  background-color: #3b1721;
  border-color: #882c42;
  color: #fecdd3;
}

html[data-theme="dark"] .seal-formula-note-box code {
  background-color: #172d59;
  color: #93c5fd;
}

/* Inline light-color safety overrides in dark mode */
html[data-theme="dark"] {
  --tier-row-bg: #12203e;
  --tier-row-border: #3d5d99;
  --text-main: #f3f7ff;
  --text-muted: #b6cae9;
}

/* Clearer frames / borders & brighter readable typography across all surfaces */
html[data-theme="dark"] .app-header {
  border-bottom: 1.5px solid #3c5b96;
}

html[data-theme="dark"] .page-tabs-bar {
  border-top: 1px solid #314b80;
}

html[data-theme="dark"] .page-tab-btn,
html[data-theme="dark"] .btn-theme-toggle,
html[data-theme="dark"] .btn-outline,
html[data-theme="dark"] .btn-auth,
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-filter-reset,
html[data-theme="dark"] .search-box input,
html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .multi-dropdown-btn,
html[data-theme="dark"] .char-list-select,
html[data-theme="dark"] .char-list-dir-btn,
html[data-theme="dark"] .detail-rec-sort-select,
html[data-theme="dark"] .detail-rec-mode-btn,
html[data-theme="dark"] .detail-rec-view-btn,
html[data-theme="dark"] .char-rec-rank-select,
html[data-theme="dark"] .char-rec-order-btn,
html[data-theme="dark"] .seal-score-input,
html[data-theme="dark"] .seal-bonus-btn,
html[data-theme="dark"] .seal-preset-btn,
html[data-theme="dark"] .seal-clear-btn {
  border-color: #4668a8;
  color: #f1f6ff;
}

html[data-theme="dark"] .home-hero-card,
html[data-theme="dark"] .home-nav-card,
html[data-theme="dark"] .home-panel,
html[data-theme="dark"] .tier-board-container,
html[data-theme="dark"] .tier-board-header,
html[data-theme="dark"] .author-card,
html[data-theme="dark"] .history-sidebar,
html[data-theme="dark"] .char-list-container,
html[data-theme="dark"] .community-page-container,
html[data-theme="dark"] .seal-bonus-bar,
html[data-theme="dark"] .seal-calc-card,
html[data-theme="dark"] .seal-formula-note-box,
html[data-theme="dark"] .modal-dialog,
html[data-theme="dark"] .detail-modal-dialog,
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .filter-overview-panel,
html[data-theme="dark"] .nav-dropdown-menu {
  border-color: #3a5892;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.5), inset 0 1px 0 rgba(148, 184, 255, 0.08);
}

html[data-theme="dark"] .tier-row {
  background-color: #12203e;
  border: 1.5px solid #41619e;
}

html[data-theme="dark"] .tier-label-box {
  border-right: 1.5px solid #41619e;
}

html[data-theme="dark"] .char-card {
  background-color: #16284d;
  border: 1.5px solid #4869ab;
}

html[data-theme="dark"] .char-card:hover {
  border-color: #7db4ff;
}

html[data-theme="dark"] .char-card.has-badge-red {
  border: 2px solid #ef4444;
}

html[data-theme="dark"] .char-card.has-badge-yellow,
html[data-theme="dark"] .char-card.has-badge-gold {
  border: 2px solid #facc15;
}

html[data-theme="dark"] .char-list-card,
html[data-theme="dark"] .char-list-simple-row,
html[data-theme="dark"] .script-card,
html[data-theme="dark"] .script-simple-row,
html[data-theme="dark"] .script-matched-char-btn,
html[data-theme="dark"] .char-rec-simple-row,
html[data-theme="dark"] .char-rec-script-card,
html[data-theme="dark"] .home-recent-char-item,
html[data-theme="dark"] .home-history-row,
html[data-theme="dark"] .home-stat-box,
html[data-theme="dark"] .history-item,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .feedback-card,
html[data-theme="dark"] .feedback-log-item,
html[data-theme="dark"] .planned-page-card,
html[data-theme="dark"] .unassigned-pool,
html[data-theme="dark"] .unassigned-cards,
html[data-theme="dark"] .char-list-filter-bar,
html[data-theme="dark"] .detail-awakened-box,
html[data-theme="dark"] .detail-awakened-empty,
html[data-theme="dark"] .detail-performance-box,
html[data-theme="dark"] .detail-evaluation-box,
html[data-theme="dark"] .detail-rec-scripts-box,
html[data-theme="dark"] .script-matched-chars-sidebar,
html[data-theme="dark"] .script-detail-effect-card,
html[data-theme="dark"] .script-detail-info-col,
html[data-theme="dark"] .script-detail-gacha-quickbar,
html[data-theme="dark"] .perf-ability-card,
html[data-theme="dark"] .perf-meta-table,
html[data-theme="dark"] .perf-stats-grid,
html[data-theme="dark"] .manage-box,
html[data-theme="dark"] .perm-check-card,
html[data-theme="dark"] .batch-options-card,
html[data-theme="dark"] .batch-drop-zone,
html[data-theme="dark"] .batch-preview-container,
html[data-theme="dark"] .batch-preview-item,
html[data-theme="dark"] .detail-tier-history-details,
html[data-theme="dark"] .detail-tier-history-list li {
  border-color: #3f5e9c;
}

html[data-theme="dark"] .char-card-name,
html[data-theme="dark"] .tbh-game-title,
html[data-theme="dark"] .tbh-main-title,
html[data-theme="dark"] .tbh-date,
html[data-theme="dark"] .tbh-condition,
html[data-theme="dark"] .tbh-criteria,
html[data-theme="dark"] .detail-char-name,
html[data-theme="dark"] .detail-tier-transition,
html[data-theme="dark"] .matrix-title-row,
html[data-theme="dark"] .evaluation-header,
html[data-theme="dark"] .reasons-list li,
html[data-theme="dark"] .reasons-list li::before,
html[data-theme="dark"] .performance-section-header,
html[data-theme="dark"] .perf-stat-value,
html[data-theme="dark"] .char-list-heading,
html[data-theme="dark"] .script-detail-effect-head,
html[data-theme="dark"] .detail-tier-history-list .th-move,
html[data-theme="dark"] .video-tier-connector,
html[data-theme="dark"] .video-skill-cond-row .vsc-eff,
html[data-theme="dark"] .video-script-mini-chip strong {
  color: #f3f7ff;
}

html[data-theme="dark"] .matrix-subtitle,
html[data-theme="dark"] .char-list-control-label,
html[data-theme="dark"] .char-list-sort-group.is-secondary .char-list-control-label,
html[data-theme="dark"] .home-history-row-top,
html[data-theme="dark"] .detail-tier-history-list .th-date,
html[data-theme="dark"] .video-script-mini-chip span,
html[data-theme="dark"] .video-memo-hist-toggle,
html[data-theme="dark"] .video-memo-hist-lbl,
html[data-theme="dark"] .video-script-top3-fallback,
html[data-theme="dark"] .th-bulk-select-all,
html[data-theme="dark"] .author-id-row,
html[data-theme="dark"] .history-detail,
html[data-theme="dark"] .footer-disclaimer-list,
html[data-theme="dark"] .footer-copyright,
html[data-theme="dark"] .community-subtitle,
html[data-theme="dark"] .faq-answer-body,
html[data-theme="dark"] .feedback-log-body,
html[data-theme="dark"] .feedback-log-meta,
html[data-theme="dark"] .planned-feature-list {
  color: #c2d4f2;
}

html[data-theme="dark"] .char-list-count,
html[data-theme="dark"] .planned-category-pill,
html[data-theme="dark"] .faq-cat-tag,
html[data-theme="dark"] .feedback-log-badge,
html[data-theme="dark"] .char-list-style-tag,
html[data-theme="dark"] .home-stat-num,
html[data-theme="dark"] .home-nav-cta,
html[data-theme="dark"] .home-panel-more-btn,
html[data-theme="dark"] .author-id-row strong,
html[data-theme="dark"] .filter-overview-group-title,
html[data-theme="dark"] .text-import-sub,
html[data-theme="dark"] .footer-text-link:hover,
html[data-theme="dark"] .author-empty-hint:hover {
  color: #7dd3fc;
}

html[data-theme="dark"] .char-list-count,
html[data-theme="dark"] .planned-category-pill,
html[data-theme="dark"] .faq-cat-tag,
html[data-theme="dark"] .feedback-log-badge {
  background-color: #19315e;
  border: 1px solid #3c62a8;
}

html[data-theme="dark"] .home-nav-card.scripts-card .home-nav-cta {
  color: #67e8f9;
}

html[data-theme="dark"] .home-nav-card.faq-card .home-nav-cta {
  color: #6ee7b7;
}

html[data-theme="dark"] .home-nav-card.feedback-card .home-nav-cta {
  color: #d8b4fe;
}

html[data-theme="dark"] .home-nav-card.tier-card:hover,
html[data-theme="dark"] .home-nav-card.sealcalc-card:hover {
  border-color: #fbbf24;
}

html[data-theme="dark"] .char-list-toolbar,
html[data-theme="dark"] .community-page-header,
html[data-theme="dark"] .author-profile-summary,
html[data-theme="dark"] .footer-bottom-bar,
html[data-theme="dark"] .tier-tip-head {
  border-color: #36528a;
}

html[data-theme="dark"] .script-matched-chars-head {
  border-bottom: 1.5px solid #3c5c99;
}

html[data-theme="dark"] .perf-ability-head {
  border-bottom: 1px dashed #3d5d99;
}

html[data-theme="dark"] .char-list-sort-group.is-secondary .char-list-dir-btn,
html[data-theme="dark"] .char-list-view-toggle,
html[data-theme="dark"] .detail-rec-view-toggle,
html[data-theme="dark"] .author-id-row,
html[data-theme="dark"] .th-bulk-bar,
html[data-theme="dark"] .th-bulk-clear-btn,
html[data-theme="dark"] .official-link-editor-row {
  background-color: #132344;
  border-color: #4162a3;
  color: #e6efff;
}

html[data-theme="dark"] .view-mode-btn {
  color: #b8cceb;
}

html[data-theme="dark"] .view-mode-btn:hover,
html[data-theme="dark"] .view-mode-btn.active,
html[data-theme="dark"] .detail-rec-view-btn.active {
  background-color: #2563eb;
  color: #ffffff;
}

/* Home nav watermarks in dark mode */
html[data-theme="dark"] .wm-tier-tiles,
html[data-theme="dark"] .wm-char-card,
html[data-theme="dark"] .wm-script-card,
html[data-theme="dark"] .wm-calc-box,
html[data-theme="dark"] .wm-faq-item,
html[data-theme="dark"] .wm-fb-panel {
  background: rgba(16, 30, 60, 0.92);
  border-color: rgba(74, 114, 191, 0.55);
  color: #d6e4fd;
}

html[data-theme="dark"] .wm-calc-pill.active {
  background: #d97706;
  border-color: #fbbf24;
  color: #ffffff;
}

/* Tier history, batch import, permission, seals & editor-pick pills */
html[data-theme="dark"] .eval-cat-block {
  border-left-color: #4869ab;
}

html[data-theme="dark"] .batch-mode-tab {
  background-color: #122140;
  border-color: #3f5e9c;
  color: #c7d8f5;
}

html[data-theme="dark"] .batch-mode-tab:hover,
html[data-theme="dark"] .batch-mode-tab.active {
  background-color: #1e3769;
  border-color: #60a5fa;
  color: #ffffff;
}

html[data-theme="dark"] .batch-unmatched-box,
html[data-theme="dark"] .text-import-status.warning,
html[data-theme="dark"] .feedback-submit-result.info {
  background-color: #382810;
  border-color: #d97706;
  color: #fde68a;
}

html[data-theme="dark"] .text-import-status.success,
html[data-theme="dark"] .feedback-submit-result.success {
  background-color: #103326;
  border-color: #10b981;
  color: #a7f3d0;
}

html[data-theme="dark"] .feedback-gas-guide {
  background-color: #122142;
  border-color: #2d4474;
}

html[data-theme="dark"] .feedback-gas-guide summary {
  color: #93c5fd;
}

html[data-theme="dark"] .feedback-gas-guide-body {
  color: #cbd5e1;
}

html[data-theme="dark"] .progress-bar-wrap {
  background-color: #182b52;
  border: 1px solid #395791;
}

html[data-theme="dark"] .perm-locked-badge {
  background-color: #1a2d55;
  border: 1px solid #3c5d9e;
  color: #cbd8f2;
}

html[data-theme="dark"] .detail-avatar-fallback,
html[data-theme="dark"] .char-rec-simple-thumb,
html[data-theme="dark"] .char-rec-script-thumb,
html[data-theme="dark"] .video-script-top3-img,
html[data-theme="dark"] .video-script-top3-fallback {
  background-color: #182a50;
  border-color: #3f5e9c;
  color: #cbd5e1;
}

html[data-theme="dark"] .perm-check-card:hover,
html[data-theme="dark"] .char-list-dir-btn:hover,
html[data-theme="dark"] .th-bulk-clear-btn:hover {
  background-color: #1d3566;
  border-color: #60a5fa;
  color: #ffffff;
}

html[data-theme="dark"] .detail-rec-mode-btn.is-editor-tab,
html[data-theme="dark"] .video-left-subcard.is-star5,
html[data-theme="dark"] .video-opt-card.is-star5,
html[data-theme="dark"] .video-eval-memo-block,
html[data-theme="dark"] .video-scripts-top3-card {
  background-color: #2b2210;
  border-color: #d97706;
  color: #fef3c7;
}

html[data-theme="dark"] .detail-rec-mode-btn.is-editor-tab.active {
  background-color: #d97706;
  border-color: #fbbf24;
  color: #ffffff;
}

html[data-theme="dark"] .char-rec-star-btn {
  background-color: #132242;
  border-color: #4668a8;
  color: #cbdcf8;
}

html[data-theme="dark"] .char-rec-star-btn.active {
  background-color: #d97706;
  border-color: #fbbf24;
  color: #ffffff;
}

html[data-theme="dark"] .char-rec-editor-pill,
html[data-theme="dark"] .video-script-rank-tag,
html[data-theme="dark"] .eval-cat-badge.is-memo,
html[data-theme="dark"] .video-memo-saved-badge,
html[data-theme="dark"] .video-memo-add-btn {
  background-color: #2c2310;
  border-color: #d97706;
  color: #fde68a;
}

html[data-theme="dark"] .char-rec-editor-pill.is-rank-2,
html[data-theme="dark"] .video-script-rank-tag.is-rank-2 {
  background-color: #1e2f52;
  border-color: #6482bd;
  color: #e2ecff;
}

html[data-theme="dark"] .char-rec-editor-pill.is-rank-3,
html[data-theme="dark"] .video-script-rank-tag.is-rank-3 {
  background-color: #362015;
  border-color: #ea580c;
  color: #fed7aa;
}

html[data-theme="dark"] .script-lv-tag.is-lv80,
html[data-theme="dark"] .script-lumina-badge,
html[data-theme="dark"] .seal-calc-pattern-badge,
html[data-theme="dark"] .video-capture-size-badge,
html[data-theme="dark"] .video-memo-hist-save-btn {
  background-color: #133159;
  border-color: #38bdf8;
  color: #bae6fd;
}

html[data-theme="dark"] .video-memo-hist-now-btn {
  background-color: #132242;
  border-color: #4668a8;
  color: #e2ecff;
}

html[data-theme="dark"] .video-memo-hist-now-btn:hover {
  background-color: #1d3566;
  border-color: #60a5fa;
  color: #ffffff;
}

html[data-theme="dark"] .seal-calc-pattern-badge.is-reverse {
  background-color: #291c54;
  border-color: #a78bfa;
  color: #ddd6fe;
}

html[data-theme="dark"] .video-left-trait-group,
html[data-theme="dark"] .video-memo-record-print,
html[data-theme="dark"] .video-memo-hist-fields {
  background-color: #0e1a34;
  border-color: #3a5892;
  color: #e4ecfc;
}

html[data-theme="dark"] .video-left-subcard.is-trait {
  background-color: #18234a;
  border-color: #4f67b8;
}

html[data-theme="dark"] .video-left-subcard.is-star4,
html[data-theme="dark"] .video-opt-card.is-star4 {
  background-color: #12284d;
  border-color: #3b82f6;
}

html[data-theme="dark"] .video-left-group-header {
  color: #7dd3fc;
}

html[data-theme="dark"] .video-eval-source-badge,
html[data-theme="dark"] .video-eval-reset-btn,
html[data-theme="dark"] .video-memo-hist-synced {
  background-color: #103329;
  border-color: #10b981;
  color: #a7f3d0;
}

html[data-theme="dark"] .video-memo-record-card.is-selected-eval {
  background-color: #0f302c;
  border-color: #2dd4bf;
}

html[data-theme="dark"] .video-memo-record-radio {
  color: #5eead4;
}

html[data-theme="dark"] .video-memo-radio-hint {
  color: #fde68a;
}

html[data-theme="dark"] .detail-tier-history-list .th-del-btn,
html[data-theme="dark"] .th-bulk-del-btn,
html[data-theme="dark"] .video-tier-transition-phrase,
html[data-theme="dark"] .video-memo-del-btn {
  background-color: #3b1722;
  border-color: #ef4444;
  color: #fecdd3;
}

html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .trait-large-textarea,
html[data-theme="dark"] .matrix-edit-table select,
html[data-theme="dark"] .inline-form input,
html[data-theme="dark"] .official-link-editor-row input,
html[data-theme="dark"] .feedback-textarea,
html[data-theme="dark"] #char-text-import-input,
html[data-theme="dark"] .video-reason-quick-input,
html[data-theme="dark"] .video-ctrl-memo-textarea,
html[data-theme="dark"] .video-memo-title-input,
html[data-theme="dark"] .video-memo-hist-date-input,
html[data-theme="dark"] .video-memo-hist-select {
  background-color: #0a142a;
  border: 1.5px solid #4566a6;
  color: #f3f7ff;
}

html[data-theme="dark"] .form-group input:focus,
html[data-theme="dark"] .form-group select:focus,
html[data-theme="dark"] .form-group textarea:focus,
html[data-theme="dark"] .search-box input:focus,
html[data-theme="dark"] .seal-score-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.28);
}

/* Inline style overrides (with or without space after colon) */
html[data-theme="dark"] [style*="color:#0f172a"]:not(.tier-label):not(.tier-badge):not(.script-matched-tier-tag):not(.eval-cat-badge),
html[data-theme="dark"] [style*="color: #0f172a"]:not(.tier-label):not(.tier-badge):not(.script-matched-tier-tag):not(.eval-cat-badge),
html[data-theme="dark"] [style*="color:#1e293b"]:not(.tier-label):not(.tier-badge):not(.script-matched-tier-tag):not(.eval-cat-badge),
html[data-theme="dark"] [style*="color: #1e293b"]:not(.tier-label):not(.tier-badge):not(.script-matched-tier-tag):not(.eval-cat-badge),
html[data-theme="dark"] [style*="color:#334155"]:not(.tier-label):not(.tier-badge):not(.script-matched-tier-tag):not(.eval-cat-badge),
html[data-theme="dark"] [style*="color: #334155"]:not(.tier-label):not(.tier-badge):not(.script-matched-tier-tag):not(.eval-cat-badge) {
  color: #edf4ff !important;
}

html[data-theme="dark"] [style*="color:#475569"]:not(.tier-label):not(.tier-badge):not(.script-matched-tier-tag):not(.eval-cat-badge),
html[data-theme="dark"] [style*="color: #475569"]:not(.tier-label):not(.tier-badge):not(.script-matched-tier-tag):not(.eval-cat-badge),
html[data-theme="dark"] [style*="color:#64748b"]:not(.tier-label):not(.tier-badge):not(.script-matched-tier-tag):not(.eval-cat-badge),
html[data-theme="dark"] [style*="color: #64748b"]:not(.tier-label):not(.tier-badge):not(.script-matched-tier-tag):not(.eval-cat-badge),
html[data-theme="dark"] [style*="color:#94a3b8"]:not(.tier-label):not(.tier-badge):not(.script-matched-tier-tag):not(.eval-cat-badge),
html[data-theme="dark"] [style*="color: #94a3b8"]:not(.tier-label):not(.tier-badge):not(.script-matched-tier-tag):not(.eval-cat-badge) {
  color: #b6cae9 !important;
}

html[data-theme="dark"] [style*="color:#1d4ed8"],
html[data-theme="dark"] [style*="color:#1e40af"],
html[data-theme="dark"] [style*="color:#2563eb"],
html[data-theme="dark"] [style*="color:#0369a1"] {
  color: #7dd3fc !important;
}

html[data-theme="dark"] [style*="color:#15803d"],
html[data-theme="dark"] [style*="color:#166534"],
html[data-theme="dark"] [style*="color:#0f766e"] {
  color: #6ee7b7 !important;
}

html[data-theme="dark"] [style*="color:#7e22ce"] {
  color: #d8b4fe !important;
}

html[data-theme="dark"] [style*="background:#ffffff"],
html[data-theme="dark"] [style*="background: #ffffff"],
html[data-theme="dark"] [style*="background:#f0f9ff"],
html[data-theme="dark"] [style*="background:#dbeafe"] {
  background: #14264a !important;
  color: #edf4ff !important;
}

html[data-theme="dark"] hr[style*="#e2e8f0"] {
  border-top-color: #3b5891 !important;
}

@media (max-width: 768px) {
  .btn-theme-toggle {
    font-size: 11.5px;
    padding: 5px 9px;
  }
}

/* ============================================================
   Modal Background Scroll Lock & Mobile Detail Sizing
   ============================================================ */
html.modal-scroll-locked {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.modal-scroll-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}

.modal-overlay {
  overscroll-behavior: contain;
}

@media (max-width: 768px) {
  .modal-overlay {
    padding: 6px;
    overflow-x: hidden;
  }

  .detail-modal-dialog,
  .char-detail-modal-dialog,
  .script-detail-modal-dialog {
    width: 100%;
    max-width: calc(100vw - 12px);
    padding: 44px 10px 14px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .detail-layout-grid,
  .detail-top-split {
    gap: 14px;
    min-width: 0;
    width: 100%;
  }

  .detail-layout-grid > *,
  .detail-main-col,
  .detail-main-col > *,
  .detail-top-split > *,
  .detail-profile-box,
  .detail-matrices-box,
  .detail-rec-sidebar,
  .detail-evaluation-box,
  .detail-performance-box,
  .detail-rec-scripts-box,
  .perf-sub-block {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .detail-evaluation-box,
  .detail-performance-box,
  .detail-rec-scripts-box {
    padding: 12px 10px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .detail-matrices-box {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .seal-matrix-table,
  .conquest-matrix-table {
    width: 100%;
    font-size: 11px;
  }

  .seal-matrix-table th,
  .seal-matrix-table td,
  .conquest-matrix-table th,
  .conquest-matrix-table td {
    padding: 5px 2px;
    font-size: 11px;
  }

  .detail-char-name {
    font-size: 20px;
    word-break: break-word;
  }

  .detail-tier-transition {
    font-size: 16px;
  }

  .detail-rec-controls,
  .char-rec-simple-row,
  .char-rec-script-card {
    max-width: 100%;
    min-width: 0;
  }
}

/* ============================================================
   Featured Home Author SNS Showcase (X & YouTube)
   ============================================================ */
.home-author-sns {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0f7ff 0%, #fff5f6 100%);
  border: 1.5px solid #93c5fd;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}

.home-author-sns-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
}

.home-author-sns-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 10px;
}

.home-author-sns-links .sns-link-btn.is-featured {
  padding: 11px 13px;
  border-radius: 9px;
  border-width: 1.5px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.home-author-sns-links .sns-link-btn.is-featured:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.16);
}

.home-author-sns-links .sns-link-btn.youtube.is-featured {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  border-color: #fb7185;
}

.home-author-sns-links .sns-link-btn.x-twitter.is-featured {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border-color: #64748b;
}

.sns-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sns-icon-badge.youtube {
  background-color: #dc2626;
  color: #ffffff;
}

.sns-icon-badge.youtube .sns-icon-svg {
  color: #ffffff;
}

.sns-icon-badge.x-twitter {
  background-color: #0f172a;
  color: #ffffff;
}

.sns-icon-badge.x-twitter .sns-icon-svg {
  color: #ffffff;
}

.sns-link-text-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sns-platform-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  opacity: 0.78;
  text-transform: uppercase;
}

.home-author-sns-links .sns-link-label {
  font-size: 13.5px;
  font-weight: 800;
}

.home-author-sns-links .sns-ext-arrow {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  background-color: rgba(15, 23, 42, 0.08);
  opacity: 0.95;
  flex-shrink: 0;
}

/* ============================================================
   Dark Mode: Complete High-Contrast Fixes (Select, Dates, Badges, SNS)
   ============================================================ */
html[data-theme="dark"] select,
html[data-theme="dark"] select option,
html[data-theme="dark"] .char-list-select,
html[data-theme="dark"] .char-list-dir-btn,
html[data-theme="dark"] .char-list-sort-group.is-secondary .char-list-select,
html[data-theme="dark"] .char-list-sort-group.is-secondary .char-list-dir-btn,
html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .detail-rec-sort-select,
html[data-theme="dark"] .char-rec-rank-select {
  background-color: #0e1a34 !important;
  border-color: #4b6eb0 !important;
  color: #f3f7ff !important;
}

html[data-theme="dark"] .char-list-dir-btn:hover,
html[data-theme="dark"] .char-list-sort-group.is-secondary .char-list-dir-btn:hover,
html[data-theme="dark"] .char-list-select:hover {
  background-color: #182b52 !important;
  border-color: #7db4ff !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .char-list-simple-metric,
html[data-theme="dark"] .char-list-metric-pill,
html[data-theme="dark"] .script-card-date,
html[data-theme="dark"] .script-date-pill,
html[data-theme="dark"] .seal-bonus-current {
  background-color: #2f230b !important;
  border-color: #d97706 !important;
  color: #fde68a !important;
}

html[data-theme="dark"] .char-list-metric-pill.is-secondary {
  background-color: #132c52 !important;
  border-color: #38bdf8 !important;
  color: #bae6fd !important;
}

html[data-theme="dark"] .home-profile-bio {
  background-color: #0e1a34;
  border-color: #3b5891;
  color: #dce8ff;
}

html[data-theme="dark"] .char-rec-editor-pill.is-rank-1,
html[data-theme="dark"] .video-script-rank-tag.is-rank-1 {
  background: linear-gradient(135deg, #fef08a, #fde047);
  border-color: #f59e0b;
  color: #422006;
}

html[data-theme="dark"] .tier-video-mode-bar.is-active {
  background: linear-gradient(90deg, #0f2e24, #13382c);
  border-color: #10b981;
  color: #a7f3d0;
}

html[data-theme="dark"] .aptitude-cell:hover,
html[data-theme="dark"] .aptitude-cell:focus {
  background-color: #1d3564;
}

html[data-theme="dark"] .video-eval-reset-btn:hover {
  background: #144537;
  color: #ecfdf5;
}

html[data-theme="dark"] .video-memo-add-btn:hover {
  background-color: #4a3712;
  color: #fef3c7;
}

html[data-theme="dark"] .detail-tier-history-list .th-del-btn:hover,
html[data-theme="dark"] .th-bulk-del-btn:hover:not(:disabled) {
  background-color: #5c1e2e;
  border-color: #f87171;
  color: #fff1f2;
}

html[data-theme="dark"] .home-author-sns {
  background: linear-gradient(135deg, #132447 0%, #26162c 100%);
  border-color: #4f7ad1;
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.45);
}

html[data-theme="dark"] .home-author-sns-title {
  color: #f3f7ff;
}

html[data-theme="dark"] .home-author-sns-links .sns-link-btn.youtube.is-featured {
  background: linear-gradient(135deg, #471625, #5e1b2f);
  border-color: #f43f5e;
  color: #ffe4e6;
}

html[data-theme="dark"] .home-author-sns-links .sns-link-btn.x-twitter.is-featured {
  background: linear-gradient(135deg, #152647, #1c325e);
  border-color: #60a5fa;
  color: #f1f6ff;
}

html[data-theme="dark"] .sns-icon-badge.x-twitter {
  background-color: #020617;
  border: 1px solid #475569;
}

html[data-theme="dark"] .home-author-sns-links .sns-ext-arrow {
  background-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

/* ============================================================
   Seal & Conquest Evaluation Symbols (Dark Mode + Mobile)
   ============================================================ */
html[data-theme="dark"] .seal-matrix-table,
html[data-theme="dark"] .conquest-matrix-table {
  border-color: #3f5e9c;
  background-color: #0e1a34;
}

html[data-theme="dark"] .seal-matrix-table th,
html[data-theme="dark"] .conquest-matrix-table th {
  background-color: #192d55;
  border-color: #3f5e9c;
  color: #f3f7ff;
}

html[data-theme="dark"] .seal-matrix-table td,
html[data-theme="dark"] .conquest-matrix-table td {
  background-color: #0e1a34;
  border-color: #355085;
  color: #e6efff;
}

html[data-theme="dark"] .seal-matrix-table .cat-header.cat-bomb {
  color: #fda4af;
}

html[data-theme="dark"] .seal-matrix-table .cat-header.cat-destroy {
  color: #86efac;
}

html[data-theme="dark"] .seal-matrix-table .cat-header.cat-shock {
  color: #93c5fd;
}

html[data-theme="dark"] .seal-matrix-table tbody th.seal-boss-header {
  background-color: #15264a;
  color: #e6efff;
}

html[data-theme="dark"] .symbol-cross {
  background-color: rgba(100, 116, 139, 0.24);
  border: 1px solid #64748b;
  color: #cbd5e1;
}

html[data-theme="dark"] .symbol-triangle {
  background-color: rgba(37, 99, 235, 0.28);
  border: 1.5px solid #60a5fa;
  color: #93c5fd;
  text-shadow: 0 0 8px rgba(96, 165, 250, 0.28);
}

html[data-theme="dark"] .symbol-circle {
  background-color: rgba(22, 163, 74, 0.26);
  border: 1.5px solid #4ade80;
  color: #86efac;
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.28);
}

html[data-theme="dark"] .symbol-double-circle {
  background-color: rgba(220, 38, 38, 0.26);
  border: 1.5px solid #f87171;
  color: #fda4af;
  text-shadow: 0 0 8px rgba(248, 113, 113, 0.35);
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.16);
}

@media (max-width: 768px) {
  .symbol-cross,
  .symbol-triangle,
  .symbol-circle,
  .symbol-double-circle {
    min-width: 23px;
    height: 21px;
    padding: 0 5px;
    border-radius: 5px;
    font-size: 13.5px;
  }
}

/* ============================================================
   Dark Mode: Gradient-Reset Overrides (Lumina, Official/Discord Links, Video Studio)
   ============================================================ */
html[data-theme="dark"] .script-lumina-badge {
  background: linear-gradient(135deg, #0c4a6e, #0369a1);
  border-color: #38bdf8;
  color: #f0f9ff;
}

html[data-theme="dark"] .sns-link-btn.official {
  background: linear-gradient(135deg, #13294d, #183461);
  border-color: #3b6fc2;
  color: #e0f2fe;
}

html[data-theme="dark"] .sns-link-btn.official:hover {
  background: linear-gradient(135deg, #1a3766, #21457d);
  border-color: #60a5fa;
  color: #ffffff;
}

html[data-theme="dark"] .sns-link-btn.discord {
  background: linear-gradient(135deg, #1d224b, #282f69);
  border-color: #6366f1;
  color: #e0e7ff;
}

html[data-theme="dark"] .tier-video-mode-bar {
  background: linear-gradient(90deg, #11203f, #162952);
  border-color: #3a5892;
  color: #eef5ff;
}

html[data-theme="dark"] .video-hero-header,
html[data-theme="dark"] .video-hero-tier-box {
  background: #122142;
  border-color: #3f5e9c;
  color: #eef5ff;
}

html[data-theme="dark"] .char-list-card-media,
html[data-theme="dark"] .script-card-media {
  background: #0b152c;
}

/* ============================================================
   Dark Mode: Character Detail Tier History Polish
   ============================================================ */
html[data-theme="dark"] .detail-tier-history-details {
  background-color: #132242;
  border-color: #4668a8;
  color: #dce8ff;
}

html[data-theme="dark"] .detail-tier-history-details summary,
html[data-theme="dark"] .detail-tier-history-title {
  color: #f3f7ff;
}

html[data-theme="dark"] .detail-tier-history-list li {
  background-color: #0e1a34;
  border-color: #3f5e9c;
}

html[data-theme="dark"] .detail-tier-history-list .th-date {
  color: #b8ccf0;
}

html[data-theme="dark"] .detail-tier-history-list .th-tier-chip {
  background-color: #1c315b;
  border-color: #4b6eb0;
  color: #f3f7ff;
}

html[data-theme="dark"] .detail-tier-history-list .th-arrow {
  color: #93c5fd;
}

html[data-theme="dark"] .detail-tier-history-list .th-reason {
  background-color: #2f230b;
  border-color: #d97706;
  color: #fde68a;
}

html[data-theme="dark"] .manage-box.is-publish-box {
  background-color: #0e2925 !important;
  border-color: #10b981 !important;
}

html[data-theme="dark"] #data-size-summary {
  background-color: #12382c !important;
  border-color: #34d399 !important;
  color: #a7f3d0 !important;
}

/* ============================================================
   Collapsible Header Edit Options & Single-Screen Tier Layout
   ============================================================ */
.btn-edit-collapse {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #93c5fd;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-edit-collapse:hover,
.btn-edit-collapse.is-open {
  background-color: #dbeafe;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.header-container .admin-actions-group {
  flex: 1 0 100%;
  width: 100%;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px dashed rgba(148, 163, 184, 0.45);
}

body.edit-options-collapsed .header-container .admin-actions-group,
body.edit-options-collapsed #tier-video-mode-bar,
body.edit-options-collapsed #tier-nohist-mode-bar {
  display: none !important;
}

html[data-theme="dark"] .btn-edit-collapse {
  background-color: #16284c;
  border-color: #4668a8;
  color: #dbeafe;
}

html[data-theme="dark"] .btn-edit-collapse:hover,
html[data-theme="dark"] .btn-edit-collapse.is-open {
  background-color: #1e3768;
  border-color: #60a5fa;
  color: #ffffff;
}

html[data-theme="dark"] .header-container .admin-actions-group {
  border-top-color: rgba(70, 104, 168, 0.6);
}

/* Balanced Tier Board + Waiting Pool sizing so both comfortably fit on one screen */
.tier-board-wrapper {
  padding: 12px 14px 20px;
}

.tier-board-header {
  padding: 9px 16px 7px;
  gap: 8px 20px;
}

.tbh-logo-img {
  width: 40px;
  height: 40px;
}

.tbh-game-title {
  font-size: 22px;
}

.tbh-main-title {
  font-size: 24px;
}

.tbh-date {
  font-size: 21px;
}

.tbh-condition,
.tbh-criteria {
  font-size: 13px;
}

.tier-row {
  min-height: 56px;
}

.tier-label-box {
  width: 62px;
  min-width: 62px;
  font-size: 21px;
  padding: 4px 3px;
}

.tier-items-box {
  min-height: 56px;
  padding: 3px 6px;
  gap: 4px;
}

.char-card {
  width: 52px;
  height: 52px;
}

.char-card-class-badge {
  font-size: 8.5px;
  padding: 1px 3px;
}

.char-card-badge {
  font-size: 8px;
  padding: 1px 3px;
}

.char-card-admin-btn {
  font-size: 9.5px;
  padding: 1px 3px;
}

.unassigned-pool {
  padding: 10px 14px;
}

.unassigned-header {
  margin-bottom: 8px;
}

.unassigned-header h3 {
  font-size: 14.5px;
}

.unassigned-hint {
  font-size: 12px;
}

.unassigned-cards {
  min-height: 56px;
  padding: 7px;
  gap: 5px;
  max-height: 175px;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .tier-board-wrapper {
    padding: 8px 6px 18px;
  }
  .tier-label-box {
    width: 48px;
    min-width: 48px;
    font-size: 18px;
  }
  .char-card {
    width: 48px;
    height: 48px;
  }
  .btn-edit-collapse {
    font-size: 11.5px;
    padding: 5px 9px;
  }
}

/* ============================================================
   Tier Table + Waiting Pool Near-Fullscreen Focus Mode
   ============================================================ */
.tier-board-wrapper {
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.tier-board-container {
  flex: 0 0 auto;
}

.tier-focus-top-strip {
  width: 100%;
  max-width: 1460px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.tier-board-filter-bar {
  width: 100%;
  max-width: 1460px;
  flex: 0 0 auto;
  padding: 8px 12px;
  background-color: #f2f7fe;
  border: 1px solid #cde0f5;
  border-radius: 8px;
  margin-bottom: 4px;
}

html[data-theme="dark"] .tier-board-filter-bar {
  background-color: var(--bg-panel);
  border-color: #2d4474;
}

body.tier-focus-mode .tier-board-filter-bar {
  max-width: 100%;
}

.tier-focus-status-label {
  margin-right: auto;
  font-size: 12.5px;
  font-weight: 800;
  color: #1e40af;
  background-color: #dbeafe;
  border: 1px solid #93c5fd;
  padding: 3px 10px;
  border-radius: 999px;
}

.tier-focus-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tier-focus-toggle-btn,
.tier-focus-action-btn {
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
}

.tier-focus-toggle-btn {
  background-color: #ffffff;
  color: #1e3a8a;
  border: 1px solid #93c5fd;
  cursor: pointer;
}

.tier-focus-toggle-btn:hover {
  background-color: #eff6ff;
  border-color: #3b82f6;
}

.tier-focus-toggle-btn.is-active {
  background-color: #334155;
  color: #ffffff;
  border-color: #475569;
}

.tier-focus-toggle-btn.is-active:hover {
  background-color: #dc2626;
  border-color: #ef4444;
}

body.tier-focus-mode .app-header,
body.tier-focus-mode .site-footer,
body.tier-focus-mode #tier-video-mode-bar,
body.tier-focus-mode #tier-nohist-mode-bar {
  display: none !important;
}

body.tier-focus-mode .tier-board-wrapper {
  max-width: 100%;
  width: 100%;
  min-height: 100vh;
  padding: 6px 10px 8px;
  gap: 5px;
  align-items: stretch;
  justify-content: flex-start;
}

body.tier-focus-mode .tier-focus-top-strip {
  max-width: 100%;
  justify-content: space-between;
}

body.tier-focus-mode .tier-board-container {
  max-width: 100%;
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

body.tier-focus-mode .tier-board-header {
  padding: 6px 14px 5px;
}

body.tier-focus-mode .tbh-logo-img {
  width: 36px;
  height: 36px;
}

body.tier-focus-mode .tbh-game-title {
  font-size: 20px;
}

body.tier-focus-mode .tbh-main-title {
  font-size: 22px;
}

body.tier-focus-mode .tbh-date {
  font-size: 19px;
}

body.tier-focus-mode .tier-rows-container {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

body.tier-focus-mode .tier-row {
  flex: 1 1 auto;
  min-height: clamp(60px, 7.6vh, 86px);
}

body.tier-focus-mode .tier-row:last-child {
  border-bottom: none;
}

body.tier-focus-mode .tier-label-box {
  width: clamp(64px, 5.5vw, 86px);
  min-width: clamp(64px, 5.5vw, 86px);
  font-size: clamp(21px, 2.7vh, 28px);
}

body.tier-focus-mode .tier-items-box {
  min-height: clamp(60px, 7.6vh, 86px);
  padding: 4px 8px;
  gap: 5px;
}

body.tier-focus-mode .char-card {
  width: clamp(54px, 6.8vh, 74px);
  height: clamp(54px, 6.8vh, 74px);
}

body.tier-focus-mode .char-card-class-badge {
  font-size: 10px;
  padding: 1px 3.5px;
}

body.tier-focus-mode .char-card-badge {
  font-size: 9px;
  padding: 1px 3.5px;
}

body.tier-focus-mode .char-card-admin-btn {
  font-size: 11px;
  padding: 1px 4px;
}

body.tier-focus-mode .unassigned-pool {
  flex: 0 0 auto;
  padding: 8px 14px;
}

body.tier-focus-mode .unassigned-cards {
  min-height: clamp(58px, 7.2vh, 78px);
  max-height: 25vh;
  padding: 6px 8px;
  gap: 5px;
  overflow-y: auto;
}

html[data-theme="dark"] .tier-focus-status-label {
  background-color: #19315e;
  border-color: #4b6eb0;
  color: #bae6fd;
}

html[data-theme="dark"] .tier-focus-toggle-btn {
  background-color: #132242;
  border-color: #4668a8;
  color: #e6efff;
}

.tier-focus-toggle-btn.tier-export-png-btn {
  border-color: #059669;
  color: #047857;
  background-color: #ecfdf5;
}

.tier-focus-toggle-btn.tier-export-png-btn:hover {
  background-color: #d1fae5;
  border-color: #047857;
}

html[data-theme="dark"] .tier-focus-toggle-btn.tier-export-png-btn {
  background-color: #0f2f28;
  border-color: #34d399;
  color: #a7f3d0;
}

html[data-theme="dark"] .tier-focus-toggle-btn.tier-export-png-btn:hover {
  background-color: #144439;
  border-color: #6ee7b7;
  color: #ffffff;
}

html[data-theme="dark"] .tier-focus-toggle-btn:hover {
  background-color: #1d3566;
  border-color: #60a5fa;
  color: #ffffff;
}

html[data-theme="dark"] .tier-focus-toggle-btn.is-active {
  background-color: #3b1c2a;
  border-color: #f87171;
  color: #ffe4e6;
}

html[data-theme="dark"] .tier-focus-toggle-btn.is-active:hover {
  background-color: #dc2626;
  border-color: #f87171;
  color: #ffffff;
}

/* Video Studio Left Skill & BLADE Group (Dark Mode) & PNG Capture Text Safety */
html[data-theme="dark"] .video-left-skill-group {
  background-color: #0e1a34;
  border-color: #3b82f6;
}

html[data-theme="dark"] .video-left-skill-group .video-left-group-header {
  color: #93c5fd;
  border-bottom-color: #2f4b82;
}

html[data-theme="dark"] .video-left-subcard.is-skill {
  background-color: #13284d;
  border-color: #60a5fa;
}

html[data-theme="dark"] .video-left-subcard.is-blade {
  background-color: #211a47;
  border-color: #a78bfa;
}

.is-capturing-png,
.is-capturing-png * {
  font-kerning: none !important;
  font-variant-ligatures: none !important;
  font-feature-settings: "palt" 0, "pkna" 0, "kern" 0 !important;
  letter-spacing: 0 !important;
}

.tier-board-container.is-capturing-png {
  box-shadow: none !important;
}

.tier-board-container.is-capturing-png .tier-video-mode-bar,
.tier-board-container.is-capturing-png .tier-nohist-mode-bar,
.tier-board-container.is-capturing-png .unassigned-pool,
.tier-board-container.is-capturing-png .tier-row-admin-tools,
.tier-board-container.is-capturing-png .char-card-admin-btn {
  display: none !important;
}

.detail-top-view-actions {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-simple-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 7px;
  border: 1.5px solid #0d9488;
  background-color: #f0fdfa;
  color: #0f766e;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.detail-simple-card-btn:hover {
  background-color: #ccfbf1;
  border-color: #0f766e;
  transform: translateY(-1px);
}

html[data-theme="dark"] .detail-simple-card-btn {
  background-color: #10322e;
  border-color: #2dd4bf;
  color: #99f6e4;
}

html[data-theme="dark"] .detail-simple-card-btn:hover {
  background-color: #15453f;
  border-color: #5eead4;
  color: #ffffff;
}

@media (max-width: 768px) {
  .detail-tier-history-details {
    padding: 10px;
  }
  .detail-tier-history-list li {
    padding: 8px 10px;
    gap: 6px 8px;
  }
}

/* Browser Simple Display Card: balanced 2-column performance layout (prevents empty voids on long Skill/BLADE/Trait knights) */
.video-studio-capture.is-simple-card {
  grid-template-columns: 1fr;
}

.simple-perf-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.simple-perf-columns.is-single-col {
  grid-template-columns: 1fr;
}

.simple-perf-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.simple-perf-col .video-left-subcard {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

@media (max-width: 780px) {
  .simple-perf-columns {
    grid-template-columns: 1fr;
  }
}

/* Tablet & Compact Upper Stage Responsive Tuning for Simple Card & Video Studio */
@media (max-width: 1320px) {
  .video-upper-stage.has-scripts {
    grid-template-columns: minmax(0, 1.32fr) minmax(255px, 0.68fr);
    gap: 10px;
  }
  .video-scripts-top3-row {
    gap: 6px;
  }
  .video-script-top3-img,
  .video-script-top3-fallback {
    max-width: 82px;
  }
  .video-script-top3-name {
    font-size: 10px;
  }
  .video-skill-cond-row {
    font-size: 9px;
    padding: 2px 4px;
  }
  .video-skill-cond-row .vsc-eff {
    font-size: 8.5px;
  }
}

@media (max-width: 1240px) {
  .video-studio-capture.has-left-col .video-upper-stage.has-scripts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .video-studio-capture {
    padding: 13px;
    gap: 12px;
  }
  .video-studio-capture.has-memo,
  .video-studio-capture.has-left-col {
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 12px;
  }
  .video-hero-header,
  .video-studio-capture.has-left-col .video-hero-header {
    flex-wrap: wrap;
    min-height: auto;
    padding: 11px 13px;
    gap: 10px;
  }
  .video-hero-left {
    flex: 1 1 250px;
    gap: 10px;
  }
  .video-hero-header .detail-avatar-wrap,
  .video-studio-capture.has-left-col .video-hero-header .detail-avatar-wrap {
    width: 88px;
    height: 88px;
  }
  .video-hero-identity {
    min-width: 0;
    gap: 7px;
  }
  .video-hero-name,
  .video-studio-capture.has-left-col .video-hero-name {
    font-size: 22px;
    word-break: break-word;
  }
  .video-hero-style,
  .video-studio-capture.has-left-col .video-hero-style {
    font-size: 14.5px;
  }
  .video-meta-pill,
  .video-studio-capture.has-left-col .video-meta-pill {
    font-size: 11.5px;
    padding: 2px 7px;
  }
  .video-hero-right-stack,
  .video-studio-capture.has-left-col .video-hero-right-stack {
    min-width: 0;
    flex: 1 1 230px;
    gap: 6px;
  }
  .video-hero-tier-box {
    padding: 6px 12px;
    gap: 3px;
  }
  .video-tier-caption {
    font-size: 11.5px;
  }
  .video-tier-chip,
  .video-studio-capture.has-left-col .video-tier-chip {
    min-width: 72px;
    padding: 4px 14px;
    font-size: 28px;
  }
  .video-hero-stats-box,
  .video-studio-capture.has-left-col .video-hero-stats-box {
    grid-template-columns: repeat(4, minmax(42px, 1fr));
    padding: 4px 5px;
    gap: 4px;
  }
  .video-stat-chip,
  .video-studio-capture.has-left-col .video-stat-chip {
    min-width: 0;
    padding: 3px 4px;
  }
  .video-stat-lbl,
  .video-studio-capture.has-left-col .video-stat-lbl {
    font-size: 10px;
  }
  .video-stat-val,
  .video-studio-capture.has-left-col .video-stat-val {
    font-size: 14px;
  }
  .video-section-card {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .video-middle-apt-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1040px) {
  .video-studio-capture.has-memo,
  .video-studio-capture.has-left-col {
    grid-template-columns: 1fr;
  }
  .video-upper-stage.has-scripts {
    grid-template-columns: 1fr;
  }
  .video-script-top3-img,
  .video-script-top3-fallback {
    max-width: 80px;
  }
}

@media (max-width: 640px) {
  .video-script-top3-img,
  .video-script-top3-fallback {
    max-width: 68px;
  }
}

/* Mobile PNG Save Preview Modal */
.png-preview-modal-dialog {
  max-width: 680px;
}

.png-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.png-preview-image-wrap {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px;
  max-height: 62vh;
  overflow: auto;
  text-align: center;
}

.png-preview-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
  -webkit-touch-callout: default;
  user-select: auto;
}

html[data-theme="dark"] .png-preview-image-wrap {
  background-color: #0f172a;
  border-color: #334155;
}

/* Tier Board Header Criteria Detail Trigger & Modal */
.tbh-criteria-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.tbh-criteria-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #0d9488;
  background-color: #f0fdfa;
  color: #0f766e;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, transform 0.12s;
}

.tbh-criteria-detail-btn:hover {
  background-color: #ccfbf1;
  border-color: #0f766e;
  transform: translateY(-1px);
}

.modal-dialog.tier-criteria-modal-dialog {
  width: min(1460px, calc(100vw - 32px));
  max-width: 1460px;
  padding: 24px 24px 22px;
}

.tier-criteria-detail-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.tier-criteria-card {
  padding: 16px 20px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background-color: #f8fafc;
  color: #1e293b;
  font-size: 15.5px;
  line-height: 1.75;
}

.tier-criteria-card.is-priority {
  background-color: #fffbeb;
  border-color: #fcd34d;
}

.tier-criteria-card.is-seal {
  background-color: #eff6ff;
  border-color: #93c5fd;
}

.tier-criteria-card.is-babel {
  background-color: #f5f3ff;
  border-color: #c4b5fd;
}

.tier-criteria-card.is-conquest {
  background-color: #fef2f2;
  border-color: #fca5a5;
}

.tier-criteria-card.is-healer {
  background-color: #ecfdf5;
  border-color: #6ee7b7;
}

.tier-criteria-card-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.tier-criteria-card p {
  margin: 0;
}

.tier-criteria-note {
  margin-top: 5px !important;
  font-size: 13.5px;
  color: #475569;
  font-weight: 600;
}

@media (min-width: 900px) {
  .modal-dialog.tier-criteria-modal-dialog {
    width: min(1460px, calc(100vw - 40px), calc(90vh * 16 / 9));
    aspect-ratio: 16 / 9;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 26px 32px 22px;
  }
  .tier-criteria-modal-dialog .modal-header {
    margin-bottom: 14px;
    flex-shrink: 0;
  }
  .tier-criteria-modal-dialog .modal-header h3 {
    font-size: clamp(22px, 1.75vw, 26px);
  }
  .tier-criteria-modal-dialog .modal-subtitle {
    font-size: clamp(14px, 1.05vw, 16px);
  }
  .tier-criteria-detail-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
  }
  .tier-criteria-card.is-priority {
    grid-column: 1 / -1;
  }
  .tier-criteria-card {
    padding: 18px 24px;
    font-size: clamp(15.5px, 1.25vw, 19px);
    line-height: 1.75;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .tier-criteria-card-title {
    font-size: clamp(17px, 1.35vw, 21px);
    margin-bottom: 8px;
  }
  .tier-criteria-note {
    font-size: clamp(13.5px, 1.05vw, 16px);
    margin-top: 6px !important;
  }
  .tier-criteria-modal-dialog .form-actions {
    flex-shrink: 0;
  }
}

html[data-theme="dark"] .tbh-criteria-detail-btn {
  background-color: #10322e;
  border-color: #2dd4bf;
  color: #99f6e4;
}

html[data-theme="dark"] .tbh-criteria-detail-btn:hover {
  background-color: #15453f;
  color: #ffffff;
}

html[data-theme="dark"] .tier-criteria-card {
  background-color: #122142;
  border-color: #2d4474;
  color: #e2ecff;
}

html[data-theme="dark"] .tier-criteria-card-title {
  color: #f8fafc;
}

html[data-theme="dark"] .tier-criteria-note {
  color: #b4c6e7;
}

.form-criteria-edit-box {
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background-color: #f8fafc;
  margin-bottom: 14px;
}

html[data-theme="dark"] .form-criteria-edit-box {
  background-color: #101e3b;
  border-color: #2d4474;
}

/* ============================================================
   Gacha Simulator View
   ============================================================ */
.gacha-target-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
}

.gacha-target-tab {
  padding: 6px 14px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s ease;
}

.gacha-target-tab.active {
  background-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.gacha-target-tab.is-soon {
  color: #64748b;
}

.gacha-target-tab.is-soon.active {
  background-color: #475569;
  color: #ffffff;
}

.gacha-banner-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.gacha-banner-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background-color: #ffffff;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.14s ease;
  text-align: center;
}

.gacha-banner-tab:hover {
  border-color: #60a5fa;
  background-color: #f8fbff;
}

.gacha-banner-tab.active {
  border-color: #2563eb;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1e3a8a;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.14);
}

.gacha-banner-tab[data-banner="limited"].active {
  border-color: #dc2626;
  background: linear-gradient(135deg, #fff5f5, #fee2e2);
  color: #991b1b;
}

.gacha-banner-tab[data-banner="anniv"].active {
  border-color: #d97706;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #92400e;
}

.gacha-banner-tab[data-banner="lumina"].active {
  border-color: #0d9488;
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  color: #115e59;
}

.gacha-banner-tab[data-banner="custom"].active {
  border-color: #7c3aed;
  background: linear-gradient(135deg, #faf5ff, #f3e8ff);
  color: #5b21b6;
}

.gacha-banner-name {
  font-size: 13.5px;
  font-weight: 800;
}

.gacha-banner-sub {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
}

.gacha-config-card {
  background-color: #f8fbff;
  border: 1px solid #c5dcf3;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gacha-banner-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.gacha-banner-desc {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  flex: 1 1 340px;
  line-height: 1.5;
}

.gacha-elbo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid #93c5fd;
  background-color: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.gacha-elbo-toggle.active {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
  color: #92400e;
}

.gacha-elbo-toggle.is-disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

.gacha-custom-box {
  background-color: #ffffff;
  border: 1px solid #d8b4fe;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gacha-custom-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.gacha-custom-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
}

.gacha-custom-field input[type="number"] {
  width: 76px;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.gacha-rate-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background-color: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
}

.gacha-rate-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  font-size: 12px;
}

.gacha-rate-pill.is-star3 {
  background-color: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.gacha-rate-pill.is-pu {
  background-color: #ede9fe;
  border-color: #a78bfa;
  color: #5b21b6;
}

.gacha-pickup-box {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gacha-pickup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.gacha-pickup-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
}

.gacha-pickup-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gacha-pickup-search {
  padding: 5px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12.5px;
  min-width: 170px;
}

.gacha-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.gacha-selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  background-color: #fef3c7;
  border: 1.5px solid #f59e0b;
  color: #78350f;
  font-size: 12px;
  font-weight: 800;
}

.gacha-selected-chip img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.gacha-selected-chip button {
  background: none;
  border: none;
  color: #b45309;
  font-weight: 900;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.gacha-summary-pickup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.gacha-open-settings-btn {
  padding: 9px 16px !important;
  font-size: 13.5px !important;
  font-weight: 800 !important;
  border-radius: 8px !important;
  margin-left: auto;
}

.gacha-settings-modal-dialog {
  width: min(940px, 95vw) !important;
  max-width: 940px !important;
  max-height: 90vh !important;
  display: flex;
  flex-direction: column;
}

.gacha-settings-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 2px;
}

.gacha-modal-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.gacha-pickup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 2px;
}

.gacha-pickup-grid.is-modal {
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 8px;
  max-height: min(46vh, 420px);
}

.gacha-pickup-grid.is-modal .gacha-pick-item {
  padding: 7px 9px;
  font-size: 12.5px;
}

.gacha-pickup-grid.is-modal .gacha-pick-item img {
  width: 38px;
  height: 38px;
}

.gacha-pickup-grid.is-modal .gacha-pick-item img.is-script {
  width: 30px;
  height: 42px;
}

.gacha-pick-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background-color: #f8fafc;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
  min-width: 0;
}

.gacha-pick-item:hover {
  border-color: #60a5fa;
  background-color: #eff6ff;
}

.gacha-pick-item.is-selected {
  border-color: #f59e0b;
  background-color: #fef3c7;
  box-shadow: inset 0 0 0 1px #f59e0b;
}

.gacha-pick-item img {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
}

.gacha-pick-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.gacha-action-bar {
  position: sticky;
  bottom: 10px;
  z-index: 45;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid #cbd5e1;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
}

.gacha-pull-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 11px 20px !important;
  font-size: 14.5px !important;
  font-weight: 800 !important;
  border-radius: 9px !important;
}

.gacha-btn-crystal,
.gacha-inline-crystal {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}

.gacha-inline-crystal {
  width: 16px;
  height: 16px;
}

.gacha-stat-crystal {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: -5px;
  margin-right: 4px;
}

.gacha-pull-btn.is-ten {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-color: #1e40af !important;
  color: #ffffff !important;
}

.gacha-pull-btn.is-until {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  border-color: #b45309 !important;
  color: #ffffff !important;
}

.gacha-pull-btn.is-until:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gacha-pull-btn.is-reset {
  margin-left: auto;
  min-height: 46px;
  padding: 12px 24px !important;
  font-size: 15px !important;
  background-color: #fef2f2 !important;
  border: 1.5px solid #ef4444 !important;
  color: #b91c1c !important;
}

.gacha-pull-btn.is-reset:hover {
  background-color: #fee2e2 !important;
}

.gacha-share-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 10px;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
}

.gacha-share-btn {
  padding: 7px 14px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  border-radius: 8px !important;
}

.gacha-share-btn.is-tweet {
  background-color: #0f172a !important;
  border-color: #0f172a !important;
  color: #ffffff !important;
}

.gacha-share-btn.is-tweet:hover {
  background-color: #1e293b !important;
}

.gacha-share-hint {
  font-size: 11.5px;
  color: #64748b;
  margin-left: auto;
}

.gacha-share-guide {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  background-color: #eff6ff;
  border: 1.5px solid #60a5fa;
}

.gacha-share-preview-img {
  width: 210px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.14);
}

.gacha-share-guide-body {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gacha-share-guide-msg {
  font-size: 13px;
  font-weight: 800;
  color: #1e3a8a;
  line-height: 1.5;
}

.gacha-share-guide-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.gacha-result-capture {
  border-radius: 10px;
}

.gacha-result-capture.is-capturing-png {
  padding: 14px;
  background-color: #ffffff;
}

.gacha-capture-brand-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
}

.gacha-result-capture.is-capturing-png .gacha-capture-brand-bar {
  display: flex;
}

.gacha-hit-banner {
  padding: 12px 16px;
  border-radius: 9px;
  margin-bottom: 14px;
  font-size: 14.5px;
  font-weight: 800;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #f59e0b;
  color: #78350f;
}

.gacha-hit-banner.is-pickup-celebration {
  background: linear-gradient(120deg, #fffbeb 0%, #fde68a 28%, #fbcfe8 64%, #c7d2fe 100%);
  border: 2.5px solid #ec4899;
  color: #701a75;
  box-shadow: 0 6px 22px rgba(236, 72, 153, 0.28), 0 0 18px rgba(245, 158, 11, 0.35);
  animation: gachaBannerCelebrate 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.gacha-hit-banner.is-warn {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

@keyframes gachaBannerCelebrate {
  0% { transform: scale(0.95); filter: brightness(1.3); }
  55% { transform: scale(1.02); filter: brightness(1.1); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes gachaPuCardPop {
  0% { transform: scale(0.84) rotate(-2deg); filter: brightness(1.5); }
  55% { transform: scale(1.06) rotate(0.8deg); filter: brightness(1.15); }
  100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
}

@keyframes gachaPuHaloPulse {
  0%, 100% {
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.38), 0 0 18px rgba(168, 85, 247, 0.4), inset 0 0 14px rgba(255, 255, 255, 0.45);
  }
  50% {
    box-shadow: 0 8px 28px rgba(236, 72, 153, 0.56), 0 0 28px rgba(250, 204, 21, 0.68), inset 0 0 22px rgba(255, 255, 255, 0.72);
  }
}

@keyframes gachaPuShimmerSweep {
  0% { transform: translateX(-140%) rotate(22deg); opacity: 0; }
  20% { opacity: 0.75; }
  60% { opacity: 0.55; }
  100% { transform: translateX(220%) rotate(22deg); opacity: 0; }
}

@keyframes gachaFxBurstRing {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0.95; }
  100% { transform: translate(-50%, -50%) scale(2.8); opacity: 0; }
}

@keyframes gachaFxParticleFly {
  0% {
    transform: translate(-50%, -50%) translate(0, 0) scale(0.4) rotate(0deg);
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--tx, 0px), var(--ty, 0px)) scale(1.15) rotate(var(--rot, 240deg));
    opacity: 0;
  }
}

@keyframes gachaCaptureAuraFlash {
  0% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.75), 0 0 36px rgba(236, 72, 153, 0.55); }
  100% { box-shadow: 0 0 0 18px rgba(250, 204, 21, 0), 0 0 0 rgba(236, 72, 153, 0); }
}

.gacha-result-capture.is-pu-celebrate {
  animation: gachaCaptureAuraFlash 1.2s ease-out;
}

.gacha-pu-fx-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3500;
  overflow: hidden;
}

.gacha-pu-fx-ring {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 6px solid rgba(250, 204, 21, 0.9);
  box-shadow: 0 0 38px rgba(236, 72, 153, 0.75), inset 0 0 28px rgba(56, 189, 248, 0.65);
  animation: gachaFxBurstRing 1.05s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.gacha-pu-fx-ring.is-second {
  border-color: rgba(244, 114, 182, 0.85);
  animation-delay: 0.14s;
  animation-duration: 1.25s;
}

.gacha-pu-fx-particle {
  position: absolute;
  left: 50%;
  top: 42%;
  width: var(--sz, 12px);
  height: var(--sz, 12px);
  border-radius: 3px;
  background: var(--col, #facc15);
  box-shadow: 0 0 10px var(--col, #facc15);
  animation: gachaFxParticleFly var(--dur, 1.4s) cubic-bezier(0.16, 1, 0.3, 1) var(--del, 0s) forwards;
}

.gacha-pu-fx-particle.is-star {
  border-radius: 50%;
  box-shadow: 0 0 14px #ffffff, 0 0 20px var(--col, #facc15);
}

.gacha-results-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.gacha-result-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 10px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background-color: #ffffff;
  text-align: center;
  position: relative;
  cursor: pointer;
}

.gacha-result-card.rarity-2 {
  background: linear-gradient(155deg, #fff8d6 0%, #fde68a 45%, #facc15 100%);
  border: 2px solid #d97706;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.22);
}

.gacha-result-card.rarity-3 {
  background: linear-gradient(135deg, #fda4af 0%, #fdba74 18%, #fde047 35%, #86efac 52%, #7dd3fc 68%, #a5b4fc 84%, #f0abfc 100%);
  border: 2.5px solid #ec4899;
  box-shadow: 0 5px 16px rgba(168, 85, 247, 0.32), 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.gacha-result-card.is-pickup {
  background: linear-gradient(135deg, #fda4af 0%, #fdba74 18%, #fde047 35%, #86efac 52%, #7dd3fc 68%, #a5b4fc 84%, #f0abfc 100%);
  border: 3px solid #dc2626;
  overflow: hidden;
  animation: gachaPuHaloPulse 2.1s ease-in-out infinite;
}

.gacha-result-card.is-pickup.is-fresh-pull {
  animation: gachaPuCardPop 0.55s cubic-bezier(0.22, 1, 0.36, 1), gachaPuHaloPulse 2.1s ease-in-out infinite;
}

.gacha-result-card.is-pickup::before {
  content: "";
  position: absolute;
  top: -30%;
  left: -40%;
  width: 55%;
  height: 160%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.72) 50%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  animation: gachaPuShimmerSweep 2.4s ease-in-out infinite;
}

.gacha-result-card.is-pickup .gacha-res-img {
  box-shadow: 0 0 0 2px #ffffff, 0 0 16px rgba(250, 204, 21, 0.85);
}

.gacha-res-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.gacha-res-tag {
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 4px;
}

.gacha-res-tag.pu {
  background-color: #dc2626;
  color: #ffffff;
}

.gacha-res-tag.guaranteed {
  background-color: #1d4ed8;
  color: #ffffff;
}

.gacha-res-stars {
  font-size: 12px;
  font-weight: 900;
  color: #64748b;
}

.rarity-2 .gacha-res-stars {
  color: #92400e;
}

.rarity-3 .gacha-res-stars {
  color: #581c87;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85);
}

.rarity-3 .gacha-res-name {
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.gacha-res-img {
  width: 116px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  object-fit: cover;
  border: 1.5px solid rgba(15, 23, 42, 0.15);
  background-color: #1e293b;
}

.gacha-res-img.is-script {
  width: 94px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 5 / 7;
  border-radius: 8px;
}

.gacha-res-img.is-awakened {
  width: 100%;
  max-width: 200px;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
}

.gacha-pick-item img.is-script {
  width: 24px;
  height: 34px;
  border-radius: 4px;
}

.gacha-col-chip img.is-script {
  width: 22px;
  height: 31px;
  border-radius: 4px;
}

.gacha-res-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  word-break: break-word;
}

.gacha-stats-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.gacha-stat-card {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
}

.gacha-stat-card.is-dia {
  background-color: #f0f9ff;
  border-color: #7dd3fc;
}

.gacha-stat-card.is-lumina {
  background-color: #faf5ff;
  border-color: #d8b4fe;
}

.gacha-stat-card strong {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
}

.gacha-stat-card.is-dia strong {
  color: #0369a1;
}

.gacha-stat-card.is-lumina strong {
  color: #7e22ce;
}

.gacha-stat-card span {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
}

.gacha-collection-box {
  background-color: #f8fbff;
  border: 1px solid #c5dcf3;
  border-radius: 10px;
  padding: 12px 14px;
}

.gacha-collection-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.gacha-collection-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gacha-col-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px 4px 4px;
  border-radius: 8px;
  border: 1.5px solid #f59e0b;
  background-color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  cursor: pointer;
}

.gacha-col-chip.is-pu {
  border-color: #dc2626;
  background-color: #fff5f5;
}

.gacha-col-chip img {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  object-fit: cover;
}

.gacha-col-count {
  background-color: #0f172a;
  color: #ffffff;
  border-radius: 999px;
  font-size: 10.5px;
  padding: 1px 6px;
}

@media (max-width: 900px) {
  .gacha-banner-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gacha-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gacha-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .gacha-action-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    bottom: 6px;
  }
  .gacha-action-bar .gacha-pull-btn {
    width: 100%;
    padding: 9px 8px !important;
    font-size: 12px !important;
    min-height: 40px;
    line-height: 1.25;
  }
  .gacha-action-bar .gacha-pull-btn.is-reset {
    margin-left: 0;
    padding: 9px 8px !important;
    font-size: 12.5px !important;
    min-height: 40px;
  }
}

@media (max-width: 520px) {
  .gacha-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

html[data-theme="dark"] .gacha-target-tabs {
  background-color: #101e3b;
  border-color: #2d4474;
}

html[data-theme="dark"] .gacha-target-tab {
  color: #cbd5e1;
}

html[data-theme="dark"] .gacha-banner-tab,
html[data-theme="dark"] .gacha-config-card,
html[data-theme="dark"] .gacha-custom-box,
html[data-theme="dark"] .gacha-rate-strip,
html[data-theme="dark"] .gacha-pickup-box,
html[data-theme="dark"] .gacha-summary-pickup-row,
html[data-theme="dark"] .gacha-stat-card,
html[data-theme="dark"] .gacha-collection-box {
  background-color: #122142;
  border-color: #2d4474;
  color: #e2ecff;
}

html[data-theme="dark"] .gacha-pull-btn.is-reset {
  background-color: #45141a !important;
  border-color: #f87171 !important;
  color: #fecaca !important;
}

html[data-theme="dark"] .gacha-pull-btn.is-reset:hover {
  background-color: #5c1922 !important;
}

html[data-theme="dark"] .gacha-banner-desc,
html[data-theme="dark"] .gacha-custom-field,
html[data-theme="dark"] .gacha-pickup-title,
html[data-theme="dark"] .gacha-collection-title,
html[data-theme="dark"] .gacha-stat-card strong,
html[data-theme="dark"] .gacha-res-name {
  color: #f1f5f9;
}

html[data-theme="dark"] .gacha-stat-card span {
  color: #93c5fd;
}

html[data-theme="dark"] .gacha-stat-card.is-dia {
  background-color: #102a4e;
  border-color: #38bdf8;
}

html[data-theme="dark"] .gacha-stat-card.is-dia strong {
  color: #7dd3fc;
}

html[data-theme="dark"] .gacha-stat-card.is-lumina {
  background-color: #2c154a;
  border-color: #c084fc;
}

html[data-theme="dark"] .gacha-stat-card.is-lumina strong {
  color: #e9d5ff;
}

html[data-theme="dark"] .gacha-hit-banner.is-pickup-celebration {
  background: linear-gradient(120deg, #4a1d6e 0%, #7c2d12 36%, #831843 72%, #312e81 100%);
  border-color: #f472b6;
  color: #fef08a;
}

html[data-theme="dark"] .gacha-elbo-toggle,
html[data-theme="dark"] .gacha-pick-item,
html[data-theme="dark"] .gacha-result-card,
html[data-theme="dark"] .gacha-col-chip,
html[data-theme="dark"] .gacha-rate-pill {
  background-color: #0e1a34;
  border-color: #36508a;
  color: #e2ecff;
}

html[data-theme="dark"] .gacha-share-bar,
html[data-theme="dark"] .gacha-action-bar {
  background-color: rgba(18, 33, 66, 0.94);
  border-color: #2d4474;
}

html[data-theme="dark"] .gacha-share-btn.is-tweet {
  background-color: #f8fafc !important;
  border-color: #f8fafc !important;
  color: #0f172a !important;
}

html[data-theme="dark"] .gacha-share-hint {
  color: #93c5fd;
}

html[data-theme="dark"] .gacha-share-guide {
  background-color: #102a4e;
  border-color: #38bdf8;
}

html[data-theme="dark"] .gacha-share-guide-msg {
  color: #e0f2fe;
}

html[data-theme="dark"] .gacha-result-capture.is-capturing-png {
  background-color: #0b1428;
}

html[data-theme="dark"] .gacha-capture-brand-bar {
  border-bottom-color: #2d4474;
  color: #f8fafc;
}

html[data-theme="dark"] .gacha-pick-item.is-selected {
  background-color: #452a08;
  border-color: #f59e0b;
}

html[data-theme="dark"] .gacha-result-card.rarity-2 {
  background: linear-gradient(155deg, #5c4207 0%, #854d0e 52%, #a16207 100%);
  border-color: #facc15;
  box-shadow: 0 3px 12px rgba(250, 204, 21, 0.25);
}

html[data-theme="dark"] .rarity-2 .gacha-res-stars {
  color: #fde047;
}

html[data-theme="dark"] .gacha-result-card.rarity-3 {
  background: linear-gradient(135deg, #881337 0%, #9a3412 18%, #854d0e 35%, #14532d 52%, #0c4a6e 68%, #3730a3 84%, #701a75 100%);
  border-color: #f472b6;
  box-shadow: 0 5px 18px rgba(244, 114, 182, 0.35);
}

html[data-theme="dark"] .rarity-3 .gacha-res-stars {
  color: #fef08a;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

html[data-theme="dark"] .rarity-3 .gacha-res-name {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

html[data-theme="dark"] .gacha-result-card.is-pickup {
  background: linear-gradient(135deg, #881337 0%, #9a3412 18%, #854d0e 35%, #14532d 52%, #0c4a6e 68%, #3730a3 84%, #701a75 100%);
  border-color: #f87171;
  box-shadow: 0 6px 22px rgba(248, 113, 113, 0.45);
}

/* ============================================================
   Resonance Tome & Level Cap Guide Styles
   ============================================================ */
.home-nav-card.levelcap-card .home-nav-icon {
  background: linear-gradient(135deg, #e0f2fe, #ede9fe);
  border-color: #93c5fd;
}

.lcg-home-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.lcg-title-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  vertical-align: -7px;
  margin-right: 4px;
}

.lcg-inline-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}

.lcg-tbl-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: -4px;
  margin-right: 4px;
}

.lcg-item-heading {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lcg-shot-single-wrap {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

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

.lcg-shot-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background-color: #f8fafc;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.14s ease, transform 0.12s ease;
  width: 100%;
}

.lcg-shot-card.is-wide {
  max-width: 620px;
}

.lcg-shot-card:hover {
  border-color: #2563eb;
  transform: translateY(-1px);
}

.lcg-shot-card img {
  width: 100%;
  height: auto;
  border-radius: 7px;
  display: block;
  object-fit: cover;
}

.lcg-shot-cap {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
}

.lcg-total-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: left;
}

.lcg-total-icon {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex-shrink: 0;
}

.lcg-recipe-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex-shrink: 0;
}

.lcg-flow-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 800;
  color: #1d4ed8;
}

.guide-toc-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding: 10px 12px;
  border-radius: 10px;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
}

.guide-toc-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #93c5fd;
  background-color: #ffffff;
  color: #1e40af;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s ease;
}

.guide-toc-pill:hover {
  background-color: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
}

.guide-sections-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.guide-section-card {
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-top: 4px solid #2563eb;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.guide-section-card.is-indigo { border-top-color: #4f46e5; }
.guide-section-card.is-teal { border-top-color: #0d9488; }
.guide-section-card.is-amber { border-top-color: #d97706; }
.guide-section-card.is-red { border-top-color: #dc2626; }
.guide-section-card.is-purple { border-top-color: #7c3aed; }

.guide-sec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.guide-sec-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background-color: #1e40af;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
}

.guide-section-card.is-indigo .guide-sec-num { background-color: #4338ca; }
.guide-section-card.is-teal .guide-sec-num { background-color: #0f766e; }
.guide-section-card.is-amber .guide-sec-num { background-color: #b45309; }
.guide-section-card.is-red .guide-sec-num { background-color: #b91c1c; }
.guide-section-card.is-purple .guide-sec-num { background-color: #6d28d9; }

.guide-sec-head h3 {
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
}

.guide-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.guide-sub-panel {
  background-color: #f8fbff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 13px 14px;
}

.guide-sub-title {
  font-size: 14px;
  font-weight: 900;
  color: #1e3a8a;
  margin-bottom: 10px;
}

.guide-bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
}

.guide-bullet-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 12px;
  border-left: 3px solid #60a5fa;
}

.guide-callout {
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
}

.guide-callout.is-blue { background: #eff6ff; border: 1.5px solid #60a5fa; color: #1e3a8a; }
.guide-callout.is-red { background: #fef2f2; border: 1.5px solid #f87171; color: #991b1b; }
.guide-callout.is-amber { background: #fffbeb; border: 1.5px solid #fbbf24; color: #78350f; }

.guide-callout p { margin: 4px 0 0; }

.lcg-flow-box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  text-align: center;
}

.lcg-flow-step {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background-color: #ffffff;
}

.lcg-flow-step.is-unlocked {
  background-color: #ecfdf5;
  border-color: #34d399;
  color: #065f46;
}

.lcg-flow-kicker {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 2px;
}

.lcg-flow-step strong { font-size: 16px; font-weight: 900; }

.lcg-flow-arrow {
  font-size: 12.5px;
  font-weight: 800;
  color: #1d4ed8;
}

.lcg-table-wrap {
  overflow-x: auto;
  margin-bottom: 12px;
}

.lcg-cost-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  font-size: 13.5px;
  text-align: center;
}

.lcg-cost-table th,
.lcg-cost-table td {
  border: 1px solid #cbd5e1;
  padding: 9px 10px;
}

.lcg-cost-table thead th {
  background-color: #1e40af;
  color: #ffffff;
  font-weight: 800;
}

.lcg-cost-table thead th.is-total-col {
  background-color: #b45309;
}

.lcg-cost-table tbody th {
  background-color: #f8fafc;
  text-align: left;
  white-space: nowrap;
}

.lcg-cost-table td.is-total-val {
  background-color: #fffbeb;
  color: #b45309;
}

.lcg-cost-table td.is-total-val small {
  display: block;
  font-size: 11px;
  color: #78350f;
}

.lcg-row-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.lcg-row-badge.is-rep { background: #e0f2fe; color: #0369a1; }
.lcg-row-badge.is-pay { background: #fef3c7; color: #92400e; }
.lcg-row-badge.is-tome { background: #ede9fe; color: #6d28d9; }

.lcg-total-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.lcg-total-card {
  border-radius: 9px;
  padding: 11px 12px;
  text-align: center;
  border: 1.5px solid #cbd5e1;
  background-color: #ffffff;
}

.lcg-total-card.is-tome { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.lcg-total-card.is-rep { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }
.lcg-total-card.is-pay { background: #f0fdf4; border-color: #86efac; color: #166534; }

.lcg-total-lbl { display: block; font-size: 12px; font-weight: 800; }
.lcg-total-card strong { display: block; font-size: 24px; font-weight: 900; margin: 2px 0; }
.lcg-total-card small { font-size: 11px; opacity: 0.85; }

.lcg-calc-box {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 11px 14px;
}

.lcg-calc-head { font-size: 13.5px; font-weight: 800; margin-bottom: 8px; color: #0f172a; }

.lcg-calc-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

.lcg-calc-controls select,
.lcg-calc-controls input {
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-weight: 700;
}

.lcg-calc-output {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lcg-calc-pill {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lcg-calc-pill strong { font-size: 17px; color: #0f172a; }
.lcg-calc-pill small { font-size: 11px; color: #64748b; }

.lcg-recipe-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
}

.lcg-recipe-item {
  min-width: 175px;
  padding: 9px 14px;
  border-radius: 8px;
  text-align: left;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.lcg-recipe-item.is-part1 { border-color: #60a5fa; background: #eff6ff; color: #1e40af; }
.lcg-recipe-item.is-part2 { border-color: #c084fc; background: #faf5ff; color: #6b21a8; }
.lcg-recipe-item.is-res { border-color: #f59e0b; background: #fffbeb; color: #b45309; }

.lcg-recipe-kicker { display: block; font-size: 11px; font-weight: 700; opacity: 0.85; }
.lcg-recipe-item strong { font-size: 16px; font-weight: 900; }
.lcg-recipe-op { font-size: 20px; font-weight: 900; color: #475569; }
.lcg-recipe-note { font-size: 12px; color: #64748b; text-align: center; margin-top: 6px; }

.lcg-source-list,
.lcg-mindset-list,
.lcg-compare-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.lcg-source-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 7px 10px;
}

.lcg-src-tag {
  font-size: 11px;
  font-weight: 900;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 5px;
  min-width: 64px;
  text-align: center;
  flex-shrink: 0;
}

.lcg-src-tag.is-ev { background: #0284c7; }
.lcg-src-tag.is-cq { background: #059669; }
.lcg-src-tag.is-sl { background: #7c3aed; }
.lcg-src-tag.is-df { background: #4338ca; }

.lcg-mindset-item {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #dc2626;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lcg-mindset-item.is-2 { border-left-color: #d97706; }
.lcg-mindset-item.is-3 { border-left-color: #16a34a; }
.lcg-mindset-item strong { color: #0f172a; }
.lcg-mindset-item span { color: #475569; line-height: 1.45; }

.guide-verdict-banner {
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1.5px solid #f59e0b;
  color: #78350f;
}

.guide-verdict-footer {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.lcg-cmp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  font-size: 12.5px;
}

.lcg-cmp-row span { font-weight: 800; color: #0f172a; }
.lcg-cmp-row em { font-style: normal; font-size: 12px; color: #475569; text-align: right; }
.lcg-cmp-row.is-critical { background: #fef2f2; border-color: #fca5a5; }
.lcg-cmp-row.is-critical span,
.lcg-cmp-row.is-critical em { color: #b91c1c; font-weight: 800; }

.lcg-char-picks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lcg-char-pick-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, transform 0.12s ease;
}

.lcg-char-pick-card:hover {
  border-color: #2563eb;
  transform: translateY(-1px);
}

.lcg-char-pick-card img {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
}

.lcg-char-pick-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.lcg-char-pick-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lcg-char-pick-top strong { font-size: 13px; color: #0f172a; }
.lcg-char-pick-body span { font-size: 12px; color: #475569; }

.tier-chip-mini {
  font-size: 10.5px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

@media (max-width: 900px) {
  .guide-two-col,
  .lcg-total-cards,
  .lcg-calc-output,
  .lcg-shot-grid-2 {
    grid-template-columns: 1fr;
  }
}

html[data-theme="dark"] .guide-toc-bar,
html[data-theme="dark"] .guide-section-card,
html[data-theme="dark"] .guide-sub-panel,
html[data-theme="dark"] .lcg-calc-box,
html[data-theme="dark"] .lcg-recipe-box {
  background-color: #122142;
  border-color: #2d4474;
  color: #e2ecff;
}

html[data-theme="dark"] .guide-toc-pill,
html[data-theme="dark"] .lcg-flow-step,
html[data-theme="dark"] .lcg-cost-table tbody th,
html[data-theme="dark"] .lcg-calc-pill,
html[data-theme="dark"] .lcg-source-row,
html[data-theme="dark"] .lcg-mindset-item,
html[data-theme="dark"] .lcg-cmp-row,
html[data-theme="dark"] .lcg-char-pick-card,
html[data-theme="dark"] .lcg-recipe-item,
html[data-theme="dark"] .lcg-shot-card {
  background-color: #0e1a34;
  border-color: #36508a;
  color: #e2ecff;
}

html[data-theme="dark"] .guide-sec-head h3,
html[data-theme="dark"] .lcg-calc-head,
html[data-theme="dark"] .lcg-calc-pill strong,
html[data-theme="dark"] .lcg-mindset-item strong,
html[data-theme="dark"] .lcg-cmp-row span,
html[data-theme="dark"] .lcg-char-pick-top strong {
  color: #f8fafc;
}

html[data-theme="dark"] .guide-sub-title { color: #93c5fd; }
html[data-theme="dark"] .guide-bullet-list,
html[data-theme="dark"] .lcg-mindset-item span,
html[data-theme="dark"] .lcg-cmp-row em,
html[data-theme="dark"] .lcg-char-pick-body span,
html[data-theme="dark"] .lcg-shot-cap {
  color: #cbd5e1;
}

html[data-theme="dark"] .guide-callout.is-blue { background: #102a4e; border-color: #38bdf8; color: #e0f2fe; }
html[data-theme="dark"] .guide-callout.is-red,
html[data-theme="dark"] .lcg-cmp-row.is-critical { background: #3f151b; border-color: #f87171; color: #fecaca; }
html[data-theme="dark"] .guide-callout.is-amber { background: #3b2809; border-color: #f59e0b; color: #fde68a; }
html[data-theme="dark"] .guide-verdict-banner { background: linear-gradient(135deg, #452a08, #5c3a0a); border-color: #f59e0b; color: #fef08a; }
html[data-theme="dark"] .guide-verdict-footer { background: #0f2f26; border-color: #10b981; color: #a7f3d0; }
html[data-theme="dark"] .lcg-total-card.is-tome { background: #3f151b; border-color: #f87171; color: #fecaca; }
html[data-theme="dark"] .lcg-total-card.is-rep { background: #102a4e; border-color: #60a5fa; color: #bfdbfe; }
html[data-theme="dark"] .lcg-total-card.is-pay { background: #0f2f26; border-color: #34d399; color: #a7f3d0; }
html[data-theme="dark"] .lcg-cost-table td.is-total-val { background: #3b2809; color: #fde047; }
html[data-theme="dark"] .lcg-cost-table td.is-total-val small { color: #fef08a; }

/* ============================================================
   Home 2-Col Community Grid & Tome Priority Tier Table
   ============================================================ */
.home-nav-grid.home-nav-grid-2col {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.tome-tier-sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tome-tier-intro-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tome-tier-note {
  margin: 0;
  font-size: 12.5px;
  color: #475569;
  font-weight: 600;
}

.tome-tier-admin-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tome-mini-btn {
  padding: 5px 11px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.tome-tier-board {
  display: flex;
  flex-direction: column;
  border: 1.5px solid #94a3b8;
  border-radius: 10px;
  overflow: hidden;
  background-color: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.tome-tier-row {
  display: flex;
  align-items: stretch;
  min-height: 92px;
  border-bottom: 1px solid #94a3b8;
  transition: background-color 0.15s ease;
}

.tome-tier-row:last-child {
  border-bottom: none;
}

.tome-tier-row.drag-over {
  background-color: #eff6ff;
  outline: 2px dashed #2563eb;
  outline-offset: -3px;
}

.tome-tier-label {
  flex: 0 0 162px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 16.5px;
  font-weight: 900;
  line-height: 1.28;
  letter-spacing: 0.01em;
  border-right: 1.5px solid #94a3b8;
  position: relative;
  word-break: keep-all;
}

.tome-row-edit-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.tome-row-edit-btn:hover {
  background: rgba(0, 0, 0, 0.65);
}

.tome-tier-items {
  flex: 1 1 auto;
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tome-tier-empty {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
  padding: 6px 4px;
}

.tome-tier-char {
  width: 78px !important;
  height: 78px !important;
  flex-shrink: 0;
  position: relative;
}

.tome-tier-char .char-card-badge {
  font-size: 8.5px;
  padding: 1px 4px;
  top: 2px;
  right: 2px;
}

.page-tab-btn.active,
.nav-dropdown-trigger.active {
  color: #ffffff !important;
}

.tome-tier-role-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
}

.tome-tier-role-badge img {
  width: 15px !important;
  height: 15px !important;
  object-fit: contain;
}

.tome-tier-card-actions {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  display: flex;
  justify-content: center;
  gap: 2px;
  z-index: 5;
}

.tome-tile-ctrl {
  width: 19px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tome-tile-ctrl:hover {
  background: #2563eb;
}

.tome-tile-ctrl.is-del {
  background: rgba(185, 28, 28, 0.9);
}

.tome-tile-ctrl.is-del:hover {
  background: #dc2626;
}

.tome-tier-add-btn {
  height: 78px;
  min-width: 84px;
  padding: 0 12px;
  border-radius: 8px;
  border: 2px dashed #60a5fa;
  background: #f0f7ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.tome-tier-add-btn:hover {
  background: #dbeafe;
  transform: translateY(-1px);
}

.tome-picker-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tome-picker-controls .gacha-pickup-search {
  flex: 1 1 180px;
}

.tome-picker-select {
  min-width: 110px;
}

.tome-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.tome-picker-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.14s ease, background-color 0.14s ease, transform 0.12s ease;
}

.tome-picker-item:hover {
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.tome-picker-item.is-selected {
  border: 2px solid #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.tome-picker-item.is-other {
  opacity: 0.85;
}

.tome-picker-item img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
}

.tome-picker-fb {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.tome-picker-name {
  font-size: 10.5px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tome-picker-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tome-picker-empty {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

@media (max-width: 640px) {
  .tome-tier-label {
    flex: 0 0 92px;
    font-size: 13px;
    padding: 8px 6px;
  }
  .tome-tier-char {
    width: 64px !important;
    height: 64px !important;
  }
  .tome-tier-add-btn {
    height: 64px;
    min-width: 72px;
    font-size: 11px;
    padding: 0 8px;
  }
}

html[data-theme="dark"] .tome-tier-note {
  color: #94a3b8;
}

html[data-theme="dark"] .tome-tier-board {
  background-color: #12203e;
  border-color: #41619e;
}

html[data-theme="dark"] .tome-tier-row {
  border-color: #41619e;
}

html[data-theme="dark"] .tome-tier-row.drag-over {
  background-color: #1a315e;
}

html[data-theme="dark"] .tome-tier-label {
  border-right-color: #41619e;
}

html[data-theme="dark"] .tome-tier-add-btn {
  background: #102a4e;
  border-color: #60a5fa;
  color: #93c5fd;
}

html[data-theme="dark"] .tome-tier-add-btn:hover {
  background: #1a3b6b;
}

html[data-theme="dark"] .tome-picker-grid {
  background: #0e1a34;
  border-color: #36508a;
}

html[data-theme="dark"] .tome-picker-item {
  background: #16284d;
  border-color: #3b5894;
}

html[data-theme="dark"] .tome-picker-item.is-selected {
  background: #1d3a70;
  border-color: #60a5fa;
}

html[data-theme="dark"] .tome-picker-name {
  color: #e2ecff;
}

.tome-tier-row-rec-lv {
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.tome-tier-lv-badge {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: #e0f2fe;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
  z-index: 4;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.tome-tier-lv-badge.is-max {
  background: linear-gradient(135deg, #b45309, #d97706);
  border-color: #fde047;
  color: #fef9c3;
}

.tome-tier-lv-badge.is-edit-mode {
  bottom: 22px;
  cursor: pointer;
}

.tome-tile-ctrl.is-lv {
  width: auto;
  padding: 0 4px;
  font-size: 9.5px;
  background: rgba(2, 132, 199, 0.9);
}

.tome-tile-ctrl.is-lv:hover {
  background: #0284c7;
}

.tome-picker-lv-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}

.tome-lv-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.tome-lv-preset-btn {
  padding: 8px 6px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

.tome-lv-preset-btn.is-active {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .tome-picker-lv-label {
  color: #e2ecff;
}

/* ============================================================
   Home Upcoming Knight Birthday Banner & Calendar
   ============================================================ */
.home-birthday-banner {
  border-radius: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #fff1f2 0%, #fef3c7 52%, #ffe4e6 100%);
  border: 2px solid #fb7185;
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.14);
}

.home-birthday-banner.is-today {
  background: linear-gradient(135deg, #fef08a 0%, #fbcfe8 48%, #bae6fd 100%);
  border-color: #f43f5e;
  box-shadow: 0 10px 28px rgba(244, 63, 94, 0.22);
}

.home-bday-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.home-bday-banner-lead {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.home-bday-banner-kicker {
  font-size: 16px;
  font-weight: 900;
  color: #be123c;
  letter-spacing: 0.02em;
}

.home-bday-banner-sub {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #7f1d1d;
}

.home-bday-banner-items {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.home-bday-banner-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 12px;
  border: 1.5px solid #fda4af;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  text-align: left;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.home-bday-banner-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(190, 18, 60, 0.16);
}

.home-bday-banner-item img,
.home-bday-banner-fb {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}

.home-bday-banner-fb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fecdd3;
  color: #9f1239;
  font-weight: 900;
}

.home-bday-banner-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-bday-banner-item-text strong {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.home-bday-countdown-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.home-bday-countdown-badge.is-today {
  background: #e11d48;
  color: #ffffff;
}

.home-bday-countdown-badge.is-tomorrow {
  background: #f59e0b;
  color: #ffffff;
}

.home-bday-countdown-badge.is-soon {
  background: #fdf2f8;
  color: #be185d;
  border: 1px solid #f9a8d4;
}

.home-bday-jump-btn {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: #fda4af !important;
  color: #be123c !important;
}

.home-birthday-panel {
  margin-bottom: 18px;
}

.home-bday-header {
  gap: 10px;
  flex-wrap: wrap;
}

.home-bday-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.home-bday-next-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
  font-size: 12px;
  font-weight: 800;
}

.home-bday-next-pill.is-today {
  background: #e11d48;
  border-color: #be123c;
  color: #ffffff;
}

.home-bday-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.home-bday-mode-tabs {
  display: inline-flex;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.home-bday-mode-btn {
  border: none;
  background: transparent;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
}

.home-bday-mode-btn.active {
  background: #ffffff;
  color: #1d4ed8;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.home-bday-month-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.bday-month-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 11px;
  cursor: pointer;
}

.bday-month-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.bday-month-tab.is-current-month {
  border-color: #f43f5e;
}

.bday-month-tab.active {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
}

.bday-month-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.14);
  color: #be123c;
  font-size: 10px;
  font-weight: 800;
}

.bday-month-tab.active .bday-month-dot {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.bday-cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.bday-cal-ym {
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
}

.bday-cal-month-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bday-summary-empty {
  font-size: 12.5px;
  color: #64748b;
  font-weight: 600;
}

.bday-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 4px;
  border-radius: 999px;
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #9f1239;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.bday-summary-chip img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.bday-summary-chip em {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 900;
  color: #e11d48;
}

.bday-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.bday-cal-dow {
  padding: 7px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  background: #f1f5f9;
  color: #334155;
  border-bottom: 1px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
}

.bday-cal-dow:nth-child(7) {
  border-right: none;
}

.bday-cal-dow.is-sun { color: #e11d48; background: #fff1f2; }
.bday-cal-dow.is-sat { color: #2563eb; background: #eff6ff; }

.bday-cal-cell {
  min-height: 76px;
  padding: 5px;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #ffffff;
}

.bday-cal-cell:nth-child(7n) {
  border-right: none;
}

.bday-cal-cell.is-pad {
  background: #f8fafc;
}

.bday-cal-cell.is-today {
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px #3b82f6;
}

.bday-cal-cell.has-bday {
  background: #fff8fa;
}

.bday-cal-cell.is-soon {
  background: #fff1f2;
  box-shadow: inset 0 0 0 2px #fb7185;
}

.bday-cal-day-num {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 800;
  color: #475569;
}

.bday-cal-cell.is-sun .bday-cal-day-num { color: #e11d48; }
.bday-cal-cell.is-sat .bday-cal-day-num { color: #2563eb; }

.bday-today-tag {
  font-size: 9px;
  font-weight: 900;
  padding: 0 4px;
  border-radius: 4px;
  background: #2563eb;
  color: #ffffff;
}

.bday-cal-day-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bday-cell-char {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid #fda4af;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s ease, border-color 0.12s ease;
  min-width: 0;
}

.bday-cell-char:hover {
  transform: translateY(-1px);
  border-color: #e11d48;
}

.bday-cell-char img {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
}

.bday-cell-char span {
  font-size: 11px;
  font-weight: 800;
  color: #881337;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Annual 12-month overview grid */
.bday-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.bday-year-card {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}

.bday-year-card.is-current-month {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.bday-year-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #eff6ff;
  border-bottom: 1px solid #cbd5e1;
  font-size: 13px;
  color: #1e293b;
}

.bday-year-card-head span {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.bday-year-card-list {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bday-year-empty {
  font-size: 11.5px;
  color: #94a3b8;
  padding: 8px 4px;
  text-align: center;
}

.bday-year-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.bday-year-row:hover {
  border-color: #fb7185;
  background: #fff1f2;
}

.bday-year-row.is-soon {
  border-color: #fb7185;
  background: #fff1f2;
}

.bday-year-date {
  min-width: 28px;
  font-size: 11.5px;
  font-weight: 900;
  color: #e11d48;
}

.bday-year-row img {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
}

.bday-year-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bday-mini-tag {
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.bday-mini-tag.is-today { background: #e11d48; color: #ffffff; }
.bday-mini-tag.is-soon { background: #fef3c7; color: #b45309; }

.birthday-edit-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.birthday-edit-toolbar .gacha-pickup-search {
  flex: 1 1 auto;
}

.birthday-edit-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 4px;
}

.birthday-edit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.birthday-edit-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
}

.birthday-thumb-upload-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 7px;
  border: 1.5px solid #cbd5e1;
  overflow: hidden;
  transition: border-color 0.14s ease, transform 0.12s ease;
}

.birthday-thumb-upload-btn::after {
  content: "📷";
  position: absolute;
  right: 0;
  bottom: 0;
  font-size: 9px;
  line-height: 1;
  padding: 1px 2px;
  background: rgba(15, 23, 42, 0.72);
  border-top-left-radius: 4px;
}

.birthday-thumb-upload-btn:hover {
  border-color: #2563eb;
  transform: scale(1.04);
}

.birthday-edit-thumb {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

.birthday-edit-thumb-empty {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #475569;
  font-weight: 900;
  font-size: 14px;
}

.birthday-edit-name-input {
  flex: 1 1 auto;
  min-width: 70px;
  width: 100%;
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 12.5px;
  font-weight: 700;
}

.birthday-add-card {
  padding: 10px;
  border: 1.5px dashed #60a5fa;
  border-radius: 9px;
  background: #eff6ff;
  margin-bottom: 10px;
}

.birthday-add-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.birthday-add-grid .gacha-pickup-search {
  flex: 1 1 150px;
}

.birthday-file-label {
  cursor: pointer;
}

.bday-row-delete-btn {
  position: static !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 2px 6px !important;
  font-size: 14px !important;
  color: #64748b;
  border-radius: 5px;
}

.bday-row-delete-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

.home-nav-icon.has-art-img {
  padding: 0;
  overflow: hidden;
  border-width: 1.5px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.14);
}

.home-nav-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.home-nav-art-img.is-center {
  object-position: center center;
}

html[data-theme="dark"] .birthday-edit-name-input {
  background: #0e1a34;
  border-color: #36508a;
  color: #f8fafc;
}

html[data-theme="dark"] .birthday-add-card {
  background: #102a4e;
  border-color: #60a5fa;
}

.birthday-edit-name-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.birthday-edit-thumb {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.birthday-edit-name {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.birthday-edit-inputs {
  display: flex;
  gap: 4px;
}

@media (max-width: 640px) {
  .bday-cal-cell {
    min-height: 56px;
    padding: 3px;
  }
  .bday-cell-char {
    flex-direction: column;
    padding: 2px;
    gap: 1px;
    align-items: center;
  }
  .bday-cell-char span {
    font-size: 9px;
    max-width: 100%;
  }
}

html[data-theme="dark"] .home-birthday-banner {
  background: linear-gradient(135deg, #3f1522 0%, #3b2809 55%, #431727 100%);
  border-color: #fb7185;
}

html[data-theme="dark"] .home-bday-banner-kicker { color: #fda4af; }
html[data-theme="dark"] .home-bday-banner-sub { color: #fecdd3; }
html[data-theme="dark"] .home-bday-banner-item { background: rgba(15, 23, 42, 0.9); border-color: #f43f5e; }
html[data-theme="dark"] .home-bday-banner-item-text strong { color: #f8fafc; }
html[data-theme="dark"] .home-bday-jump-btn { background: rgba(15, 23, 42, 0.85) !important; color: #fda4af !important; border-color: #f43f5e !important; }
html[data-theme="dark"] .home-bday-next-pill { background: #3f1522; border-color: #be123c; color: #fda4af; }
html[data-theme="dark"] .home-bday-mode-tabs { background: #0e1a34; border-color: #36508a; }
html[data-theme="dark"] .home-bday-mode-btn { color: #cbd5e1; }
html[data-theme="dark"] .home-bday-mode-btn.active { background: #2563eb; color: #ffffff; }
html[data-theme="dark"] .bday-month-tab,
html[data-theme="dark"] .bday-month-nav-btn { background: #16284d; border-color: #36508a; color: #e2ecff; }
html[data-theme="dark"] .bday-month-tab.active { background: #2563eb; border-color: #60a5fa; color: #ffffff; }
html[data-theme="dark"] .bday-cal-ym { color: #f8fafc; }
html[data-theme="dark"] .bday-cal-grid,
html[data-theme="dark"] .bday-cal-dow,
html[data-theme="dark"] .bday-cal-cell,
html[data-theme="dark"] .bday-year-card,
html[data-theme="dark"] .bday-year-card-head,
html[data-theme="dark"] .bday-year-row,
html[data-theme="dark"] .birthday-edit-row {
  border-color: #36508a;
}
html[data-theme="dark"] .bday-cal-dow { background: #0e1a34; color: #cbd5e1; }
html[data-theme="dark"] .bday-cal-dow.is-sun { background: #2e101c; color: #fda4af; }
html[data-theme="dark"] .bday-cal-dow.is-sat { background: #10254a; color: #93c5fd; }
html[data-theme="dark"] .bday-cal-cell { background: #12203e; }
html[data-theme="dark"] .bday-cal-cell.is-pad { background: #0b152b; }
html[data-theme="dark"] .bday-cal-cell.has-bday { background: #22142d; }
html[data-theme="dark"] .bday-cal-cell.is-soon { background: #3b1322; }
html[data-theme="dark"] .bday-cal-day-num { color: #cbd5e1; }
html[data-theme="dark"] .bday-cell-char,
html[data-theme="dark"] .bday-summary-chip,
html[data-theme="dark"] .bday-year-row {
  background: #16284d;
  color: #ffe4e6;
  border-color: #be123c;
}
html[data-theme="dark"] .bday-cell-char span { color: #fda4af; }
html[data-theme="dark"] .bday-year-card { background: #12203e; }
html[data-theme="dark"] .bday-year-card-head { background: #0e1a34; color: #f8fafc; }
html[data-theme="dark"] .birthday-edit-row { background: #12203e; }
html[data-theme="dark"] .birthday-edit-name { color: #f8fafc; }

/* ============================================================
   PC & Tablet Readability Typography Scale (min-width: 769px)
   ============================================================ */
@media (min-width: 769px) {
  body {
    font-size: 16px;
    line-height: 1.65;
  }

  .site-title-main {
    font-size: 25px;
  }
  .site-subtitle {
    font-size: 12.5px;
  }
  .nav-dropdown-item {
    font-size: 14.5px;
  }
  .page-tabs-inner > .page-tab-btn,
  .page-tabs-inner > .nav-dropdown-wrap > .page-tab-btn {
    font-size: 12.5px;
  }

  /* Home Screen */
  .home-hero-title {
    font-size: 27px;
  }
  .home-hero-desc {
    font-size: 15px;
    line-height: 1.6;
  }
  .home-stat-lbl {
    font-size: 13px;
  }
  .home-nav-section-head {
    font-size: 16.5px;
  }
  .home-nav-title-row h3 {
    font-size: 19.5px;
  }
  .home-nav-badge {
    font-size: 12.5px;
  }
  .home-nav-body p {
    font-size: 15px;
    line-height: 1.6;
  }
  .home-nav-cta {
    font-size: 14.5px;
  }
  .home-panel-header h3 {
    font-size: 17.5px;
  }
  .home-panel-more-btn {
    font-size: 13px;
  }
  .home-recent-char-name {
    font-size: 15px;
  }
  .home-recent-char-sub {
    font-size: 13px;
  }
  .home-history-row {
    font-size: 13.5px;
    line-height: 1.55;
  }
  .site-disclaimer-box,
  .site-disclaimer-list li {
    font-size: 13.5px;
    line-height: 1.65;
  }

  /* Birthday Banner & Calendar */
  .home-bday-banner-kicker {
    font-size: 18px;
  }
  .home-bday-banner-sub {
    font-size: 13.5px;
  }
  .home-bday-banner-item-text strong {
    font-size: 15.5px;
  }
  .home-bday-next-pill {
    font-size: 13px;
  }
  .home-bday-mode-btn,
  .bday-month-tab,
  .bday-year-row,
  .bday-summary-chip {
    font-size: 13.5px;
  }
  .bday-cal-day-num {
    font-size: 13px;
  }
  .bday-cell-char span {
    font-size: 12.5px;
  }

  /* Tier Board & Detail Modal */
  .tier-board-subtitle,
  .tier-meta-info {
    font-size: 14.5px;
  }
  .detail-char-name {
    font-size: 24px;
  }
  .detail-evaluation-box li,
  .detail-reason-list li,
  .detail-skill-desc,
  .detail-perf-table th,
  .detail-perf-table td,
  .seal-matrix-table th,
  .seal-matrix-table td {
    font-size: 14.5px;
    line-height: 1.65;
  }

  /* Lists, Scripts & Community Pages */
  .char-list-heading,
  .community-title-block h2 {
    font-size: 22px;
  }
  .community-subtitle,
  .char-list-count {
    font-size: 14.5px;
  }
  .char-list-card-name,
  .script-card-title {
    font-size: 16px;
  }
  .char-list-card-meta,
  .char-list-simple-row,
  .script-skill-desc,
  .script-skill-head {
    font-size: 14px;
    line-height: 1.6;
  }

  /* Level Cap Guide & Tome Priority Tier */
  .guide-toc-pill {
    font-size: 13.5px;
  }
  .guide-sec-head h3 {
    font-size: 19px;
  }
  .guide-sub-title,
  .guide-verdict-banner,
  .lcg-calc-head {
    font-size: 16px;
  }
  .guide-bullet-list,
  .guide-callout p,
  .guide-callout strong,
  .guide-verdict-footer,
  .lcg-mindset-item strong,
  .lcg-mindset-item span,
  .lcg-source-row,
  .lcg-cmp-row,
  .lcg-cost-table,
  .tome-tier-note,
  .lcg-char-pick-body span {
    font-size: 14.5px;
    line-height: 1.62;
  }
  .tome-tier-label {
    font-size: 18px;
  }

  /* FAQ, Feedback, Seal Calc & Gacha */
  .faq-q-text {
    font-size: 16.5px;
  }
  .faq-answer-body {
    font-size: 15px;
    line-height: 1.7;
  }
  .feedback-card-title,
  .seal-calc-title,
  .gacha-header-title {
    font-size: 18px;
  }
  .feedback-label,
  .feedback-input,
  .feedback-textarea,
  .feedback-log-body,
  .feedback-log-note,
  .seal-calc-desc,
  .seal-formula-note-box,
  .seal-result-sub,
  .gacha-pool-hint,
  .gacha-stat-label {
    font-size: 14.5px;
    line-height: 1.6;
  }
}

@media (min-width: 1220px) {
  .page-tabs-inner > .page-tab-btn,
  .page-tabs-inner > .nav-dropdown-wrap > .page-tab-btn {
    font-size: 13px;
    padding: 6px 10px;
  }
}

/* ============================================================
   Edit-Mode Smartphone Preview Modal
   ============================================================ */
.mobile-preview-modal-dialog {
  width: min(94vw, 880px);
  max-width: 880px;
  max-height: 94vh;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 10px;
}

.mobile-preview-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-preview-title-group h3 {
  font-size: 17px;
  margin: 0;
  color: #0f172a;
}

.mobile-preview-hint {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.mobile-preview-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mobile-preview-sizes {
  display: inline-flex;
  gap: 4px;
}

.mobile-size-btn {
  padding: 4px 9px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.mobile-size-btn.active {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

.mobile-preview-stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  padding: 8px 4px;
  background: #e2e8f0;
  border-radius: 12px;
  flex: 1 1 auto;
}

.mobile-preview-device {
  width: 390px;
  max-width: 100%;
  background: #0f172a;
  border-radius: 30px;
  padding: 12px 10px 14px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.35), inset 0 0 0 2px #334155;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: width 0.2s ease;
}

.mobile-preview-notch {
  width: 110px;
  height: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-preview-notch span {
  display: block;
  width: 56px;
  height: 5px;
  border-radius: 999px;
  background: #334155;
}

.mobile-preview-iframe {
  width: 100%;
  height: min(72vh, 720px);
  border: none;
  border-radius: 18px;
  background: #edf5fc;
}

html[data-theme="dark"] .mobile-preview-topbar {
  border-bottom-color: #36508a;
}

html[data-theme="dark"] .mobile-preview-title-group h3 {
  color: #f8fafc;
}

html[data-theme="dark"] .mobile-preview-hint {
  color: #94a3b8;
}

html[data-theme="dark"] .mobile-preview-stage {
  background: #070e1c;
}

/* ============================================================
   Mobile Level-Cap Guide & Tome Tier Responsive Fixes
   ============================================================ */
.community-page-wrapper,
.community-page-container,
.guide-sections-stack,
.guide-section-card,
.guide-sub-panel,
.lcg-table-wrap,
.tome-tier-board,
.tome-tier-row,
.tome-tier-items {
  min-width: 0;
  max-width: 100%;
}

.community-page-wrapper {
  width: 100%;
  overflow-x: hidden;
}

.community-page-container,
.guide-sections-stack,
.guide-section-card {
  width: 100%;
}

.lcg-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  #level-cap-view-section.community-page-wrapper {
    padding: 10px 8px 24px;
    overflow-x: hidden;
  }

  #level-cap-view-section .community-page-container {
    padding: 12px 10px;
    border-radius: 12px;
  }

  #level-cap-view-section .community-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  #level-cap-view-section .community-title-block h2 {
    font-size: 17.5px;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  #level-cap-view-section .community-subtitle {
    font-size: 12.5px;
    line-height: 1.5;
  }

  .guide-toc-bar {
    padding: 8px;
    gap: 6px;
    margin-bottom: 14px;
  }

  .guide-toc-pill {
    font-size: 12px;
    padding: 5px 10px;
  }

  .guide-sections-stack {
    gap: 14px;
  }

  .guide-section-card {
    padding: 14px 12px;
    border-radius: 10px;
  }

  .guide-sec-head {
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .guide-sec-head h3 {
    font-size: 15.5px;
    line-height: 1.38;
    min-width: 0;
    word-break: break-word;
  }

  .guide-sub-panel {
    padding: 11px 11px;
  }

  .guide-sub-title {
    font-size: 13.5px;
    margin-bottom: 8px;
  }

  .guide-bullet-list,
  .guide-callout,
  .lcg-mindset-item,
  .lcg-source-row,
  .guide-verdict-banner,
  .guide-verdict-footer {
    font-size: 13px;
    line-height: 1.6;
  }

  .lcg-flow-arrow {
    flex-wrap: wrap;
    font-size: 12px;
  }

  .lcg-cost-table {
    min-width: 480px;
    font-size: 12px;
  }

  .lcg-cost-table th,
  .lcg-cost-table td {
    padding: 7px 6px;
  }

  .lcg-calc-controls {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
  }

  .lcg-recipe-box {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px;
  }

  .lcg-recipe-op {
    text-align: center;
    font-size: 16px;
    line-height: 1;
  }

  .lcg-cmp-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 8px 10px;
  }

  .lcg-cmp-row em {
    text-align: left;
    font-size: 12.5px;
  }

  .lcg-source-row {
    flex-wrap: wrap;
    gap: 5px;
  }

  .tome-tier-label {
    flex: 0 0 88px;
    font-size: 12.5px;
    padding: 8px 5px;
  }

  .tome-tier-row-rec-lv {
    font-size: 9.5px;
    padding: 1px 5px;
  }

  .tome-tier-items {
    padding: 6px 8px;
    gap: 6px;
  }

  .tome-tier-char {
    width: 62px !important;
    height: 62px !important;
  }

  .tome-tier-lv-badge {
    font-size: 9px;
    padding: 1px 5px;
  }

  .tome-tier-empty {
    font-size: 11.5px;
    line-height: 1.4;
  }

  .feedback-gform-iframe {
    height: 680px;
  }

  .feedback-gform-external-box,
  .feedback-gform-empty-box {
    padding: 26px 14px;
  }
}

html[data-theme="dark"] .feedback-gform-iframe {
  border-color: #334155;
}

html[data-theme="dark"] .feedback-gform-external-box,
html[data-theme="dark"] .feedback-gform-empty-box {
  background-color: #0f1b35;
  border-color: #3b5998;
}

html[data-theme="dark"] .feedback-gform-ext-desc,
html[data-theme="dark"] .feedback-gform-fallback-note {
  color: #cbd5e1;
}

html[data-theme="dark"] .feedback-gform-admin-cue {
  background-color: #172554;
  border-color: #3b82f6;
  color: #93c5fd;
}
