* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f6fb;
  color: #1f2937;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 32px;
}

.hero p {
  margin: 0;
  color: #6b7280;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.panel {
  background: #ffffff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.panel h2 {
  margin-top: 0;
  margin-bottom: 16px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.search-input {
  flex: 1;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.secondary-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #1f2937;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.secondary-btn:hover {
  background: #f3f4f6;
  border-color: #c7ced9;
}

.selected-box {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
  padding: 12px;
  margin-bottom: 16px;
}

.selected-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.selected-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
}

.selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #dbeafe;
  color: #1e3a8a;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.blocked-tag {
  background: #fee2e2;
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.12);
}

.tag-remove-btn {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: inherit;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s ease, transform 0.15s ease;
}

.tag-remove-btn:hover {
  background: #ffffff;
  transform: scale(1.08);
}

.tag-remove-btn:active {
  transform: scale(0.96);
}

.skills-list {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 16px;
  background: #fafafa;
}

.character-list {
  max-height: 220px;
}

.skill-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid #ececec;
}

.skill-item:last-child {
  border-bottom: none;
}

.skill-item input {
  margin-top: 4px;
}

.skill-name {
  font-size: 14px;
  line-height: 1.4;
}

.inline-meta {
  color: #6b7280;
  font-weight: normal;
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.config-card {
  background: linear-gradient(180deg, #fbfcff 0%, #f3f6fc 100%);
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.config-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

.input-shell {
  display: block;
  width: 100%;
}

.styled-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.2;
  outline: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    transform 0.05s ease;
}

.styled-input:hover {
  border-color: #94a3b8;
  background: #fcfdff;
}

.styled-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  background: #ffffff;
}

input.styled-input[type="number"] {
  text-align: left;
}

select.styled-input {
  cursor: pointer;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

select.styled-input::-ms-expand {
  display: none;
}

.primary-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #2563eb;
  color: white;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.08s ease;
}

.primary-btn:hover {
  background: #1d4ed8;
}

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

.primary-btn:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

.muted {
  color: #6b7280;
}

.combo-block {
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
}

.combo-block h4 {
  margin: 0 0 10px;
}

.combo-section {
  margin-top: 12px;
}

.empty-state {
  padding: 12px;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
}

.result-block {
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
}

.result-block h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.result-list {
  margin: 0;
  padding-left: 18px;
}

.result-list li {
  margin-bottom: 10px;
  line-height: 1.5;
}

.meta-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 12px;
  vertical-align: middle;
}

.rarity-badge {
  font-weight: 700;
}

.rarity-r {
  background: #e5e7eb;
  color: #374151;
}

.rarity-sr {
  background: #dbeafe;
  color: #1d4ed8;
}

.rarity-ssr {
  background: #fef3c7;
  color: #b45309;
}

.skill-desc {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.result-tag {
  background: #e8f0ff;
  color: #1d4ed8;
}

.missing-tag {
  background: #fee2e2;
  color: #991b1b;
}

.success-tag {
  background: #dcfce7;
  color: #166534;
}

.character-box {
  margin-top: 8px;
}

.link-action {
  border: none;
  background: transparent;
  padding: 0;
  color: #1d4ed8;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.link-action:hover {
  text-decoration: underline;
}

.blocked-item {
  color: #991b1b;
}

.character-list {
  max-height: 220px;
}

.character-list .skill-item {
  cursor: pointer;
}

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

  .toolbar {
    flex-direction: column;
  }

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