.theme-intro {
  margin-bottom: 1rem;
  border: 1px solid var(--color-panel-border);
  border-radius: 0.8rem;
  background: var(--color-panel);
  padding: 0.85rem 1rem;
}

.theme-intro p {
  margin: 0.2rem 0 0;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.9rem;
}

.theme-card {
  overflow: hidden;
  border: 1px solid var(--color-panel-border);
  border-radius: 0.85rem;
  background: var(--color-panel);
  box-shadow: var(--shadow-panel);
  transition: border-color 150ms ease, transform 150ms ease;
}

.theme-card:hover {
  transform: translateY(-2px);
}

.theme-card-selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-focus-ring), var(--shadow-panel);
}

.theme-preview {
  display: grid;
  gap: 0.45rem;
  min-height: 118px;
  align-content: center;
  padding: 1rem;
}

.theme-preview-bar,
.theme-preview-row {
  display: block;
  height: 0.52rem;
  border-radius: 999px;
}

.theme-preview-bar {
  width: 88%;
}

.theme-preview-row {
  width: 70%;
  height: 0.34rem;
}

.theme-preview-row-long {
  width: 94%;
}

.theme-preview-row-short {
  width: 52%;
}

.theme-preview-default {
  background: #f7f9fc;
}
.theme-preview-default .theme-preview-bar { background: #1673ea; }
.theme-preview-default .theme-preview-row { background: #b9c8dc; }

.theme-preview-dark {
  background: #121611;
}
.theme-preview-dark .theme-preview-bar { background: linear-gradient(90deg, #d7a63f, #42c4b8); }
.theme-preview-dark .theme-preview-row { background: #5c6047; }

.theme-preview-forest {
  background: linear-gradient(145deg, #e3eddc, #f8fbf5);
}
.theme-preview-forest .theme-preview-bar { background: #347b48; }
.theme-preview-forest .theme-preview-row { background: #a9c3a1; }

.theme-preview-sakura {
  background: linear-gradient(145deg, #fff5f7, #fde6ed);
}
.theme-preview-sakura .theme-preview-bar { background: #d35d7d; }
.theme-preview-sakura .theme-preview-row { background: #dcb7c4; }

.theme-preview-cyber {
  background:
    linear-gradient(rgba(22, 224, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 224, 255, 0.08) 1px, transparent 1px),
    #070b18;
  background-size: 16px 16px;
}
.theme-preview-cyber .theme-preview-bar { background: linear-gradient(90deg, #d33cff, #16e0ff); }
.theme-preview-cyber .theme-preview-row { background: #234f68; }

.theme-card-body {
  display: grid;
  gap: 0.45rem;
  border-top: 1px solid var(--color-border);
  padding: 0.9rem;
}

.theme-card-body h3,
.theme-card-body p {
  margin: 0;
}

.theme-card-body p {
  min-height: 3.2em;
  color: var(--color-muted);
  font-size: 0.78rem;
}

.theme-badge {
  width: fit-content;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-primary);
  padding: 0.12rem 0.42rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.theme-select-button {
  width: 100%;
  margin-top: 0.2rem;
}
