:root {
  color-scheme: light;
  --bg: #343a45;
  --bg-line: rgba(136, 148, 168, 0.08);
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: #d9e0e8;
  --accent: #1f7a8c;
  --accent-strong: #125e6b;
  --danger: #a04046;
  --gold: #a76f16;
  --shadow: 0 12px 32px rgba(31, 41, 51, 0.08);
  --detail-width: 440px;
  --pane-gap: 8px;
  --dark-panel: rgba(8, 12, 18, 0.62);
  --dark-panel-border: rgba(196, 207, 226, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-bottom: 124px;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), var(--bg-line) 25%, transparent calc(25% + 1px)),
    linear-gradient(0deg, transparent 0, transparent calc(50% - 1px), rgba(136, 148, 168, 0.06) 50%, transparent calc(50% + 1px)),
    linear-gradient(180deg, #2d323c 0%, var(--bg) 54%, #444b57 100%);
  background-attachment: fixed;
  background-color: var(--bg);
  background-size: 320px 320px, 320px 320px, auto;
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  scrollbar-gutter: stable;
}

er-items-app,
er-skill-maintenance-app,
er-color-custom-app {
  display: block;
}

.site-header {
  background: rgba(8, 12, 18, 0.72);
  border-bottom: 1px solid rgba(196, 207, 226, 0.18);
  box-shadow: 0 10px 28px rgba(4, 8, 14, 0.18);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0;
}

.site-title {
  color: #edf2f8;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0;
  border-bottom: 2px solid transparent;
  color: #d9e2ee;
  font-weight: 700;
  text-decoration: none;
}

.site-nav-link:hover,
.site-nav-link.is-active {
  border-bottom-color: rgba(72, 171, 190, 0.92);
  color: #a8e7f1;
}

.site-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  width: 100%;
  padding: 10px 16px 12px;
  background: #080c12;
  border-top: 1px solid rgba(196, 207, 226, 0.18);
  box-shadow: 0 -10px 28px rgba(4, 8, 14, 0.18);
  color: #b7c0cf;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.site-footer p {
  margin: 3px 0 0;
}

.license-page {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.license-panel {
  display: grid;
  gap: 12px;
  padding: 24px;
  background: rgba(8, 12, 18, 0.62);
  border: 1px solid rgba(196, 207, 226, 0.18);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(4, 8, 14, 0.22);
  color: #edf2f8;
}

.license-panel p {
  margin: 0;
  color: #d9e2ee;
  font-weight: 600;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.color-custom-main {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.page-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-topbar h1 {
  color: #edf2f8;
}

.lead {
  margin: 8px 0 0;
  color: #b7c0cf;
}

.preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(340px, 1fr);
  align-items: stretch;
  gap: 16px;
}

.color-list {
  display: grid;
  gap: 10px;
  width: 100%;
}

.adjacency-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(20px, 1fr));
  gap: 16px;
  width: min(100%, 560px);
  margin: 16px auto 0;
}

.tools-row {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  margin: 18px 0 0;
}

.export-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  padding: 14px;
  margin: 0 0 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.adjacency-panel {
  margin-top: 24px;
}

.adjacency-panel summary {
  cursor: pointer;
  color: #edf2f8;
  font-weight: 700;
}

.shuffle-button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0 14px;
}

.export-status {
  color: var(--muted);
  font-size: 0.86rem;
  min-width: 7em;
}

.shuffle-button:hover {
  border-color: var(--accent);
}

.shuffle-button:focus-visible {
  outline: 3px solid rgba(31, 122, 140, 0.16);
  outline-offset: 2px;
}

.hover-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #b7c0cf;
  cursor: pointer;
  font-size: 0.92rem;
  user-select: none;
}

.hover-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.adjacency-cell {
  aspect-ratio: 2 / 1;
  min-height: 18px;
  border: 1px solid rgba(196, 207, 226, 0.18);
  cursor: none;
  background: linear-gradient(
    to right,
    var(--left-color) 0,
    var(--left-color) 50%,
    var(--right-color) 50%,
    var(--right-color) 100%
  );
  transition: filter 120ms ease, opacity 120ms ease;
}

.adjacency-grid.is-hover-focus .adjacency-cell.is-dimmed {
  filter: brightness(0.34);
  opacity: 0.72;
}

.color-row {
  display: grid;
  grid-template-columns: minmax(82px, 110px) minmax(116px, 150px) minmax(120px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--dark-panel-border);
  border-radius: 8px;
  background: var(--dark-panel);
  box-shadow: 0 10px 28px rgba(4, 8, 14, 0.22);
  color: #edf2f8;
}

.color-label {
  color: #b7c0cf;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
}

.color-input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  letter-spacing: 0;
  padding: 0 12px;
  outline: none;
}

.color-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 122, 140, 0.16);
}

.color-input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(160, 64, 70, 0.16);
}

.color-swatch {
  position: relative;
  width: 100%;
  height: 40px;
  border: 1px solid rgb(255 255 255 / 0.24);
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgb(255 255 255 / 0.12) 25%, transparent 25%),
    linear-gradient(-45deg, rgb(255 255 255 / 0.12) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgb(255 255 255 / 0.12) 75%),
    linear-gradient(-45deg, transparent 75%, rgb(255 255 255 / 0.12) 75%);
  background-color: transparent;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.color-swatch.is-invalid {
  border-color: var(--danger);
}

.color-picker {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  cursor: pointer;
  opacity: 0;
  padding: 0;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h1 {
  color: #edf2f8;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 700;
}

.topbar p {
  margin: 8px 0 0;
  color: #b7c0cf;
}

.status {
  min-height: 22px;
  color: #f2a4aa;
  text-align: right;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(118px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 14px;
  margin-bottom: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--detail-width);
  gap: var(--pane-gap);
  align-items: start;
}

.list-pane {
  min-width: 0;
}

label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

input:focus,
select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 122, 140, 0.16);
}

.list {
  display: grid;
  gap: 8px;
}

.row {
  min-width: 0;
  overflow: hidden;
  content-visibility: auto;
  background: rgba(8, 12, 18, 0.62);
  border: 1px solid rgba(196, 207, 226, 0.18);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(4, 8, 14, 0.22);
  color: #edf2f8;
  cursor: pointer;
  contain-intrinsic-size: 74px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.row:focus-visible {
  outline: 3px solid rgba(31, 122, 140, 0.28);
  outline-offset: 2px;
}

.row.selected {
  border-color: rgba(72, 171, 190, 0.92);
  background: rgba(11, 27, 34, 0.82);
  box-shadow:
    0 0 0 2px rgba(72, 171, 190, 0.3),
    0 14px 34px rgba(4, 8, 14, 0.28);
}

.row.selected .row-media {
  border-color: rgba(168, 231, 241, 0.46);
}

.grade-bg-Common {
  background: #303742;
  --image-bg: #46505f;
}

.grade-bg-Uncommon {
  background: #213a35;
  --image-bg: #2f6b55;
}

.grade-bg-Rare {
  background: #24364f;
  --image-bg: #315f99;
}

.grade-bg-Epic {
  background: #352d4b;
  --image-bg: #614d8f;
}

.grade-bg-Legend {
  background: #463924;
  --image-bg: #8b6b2c;
}

.grade-bg-Mythic {
  background: #4a3028;
  --image-bg: #8f4f35;
}

.grade-bg-Unknown {
  background: #303742;
  --image-bg: #46505f;
}

.row-media.has-image::before,
.drawer-media.has-image::before,
.material-media.has-image::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--image-bg-width);
  height: var(--image-bg-height);
  background: var(--image-bg, rgba(31, 41, 51, 0.12));
  transform: translate(-50%, -50%);
}

.row-media img[hidden],
.material-media img[hidden],
.placeholder[hidden],
.marker:not(.crimson, .dawn) {
  display: none;
}

.placeholder {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-weight: 700;
}

.marker {
  position: absolute;
  left: 50%;
  top: var(--marker-top);
  width: var(--marker-width);
  height: var(--marker-height);
  padding: 0;
  border-radius: 0;
  clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%);
  color: #fff;
  font-size: 0;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.marker.crimson {
  background: linear-gradient(90deg, #8f1d28, #e34855, #8f1d28);
}

.marker.dawn {
  background: linear-gradient(90deg, #1d5fb8, #58a6ff, #1d5fb8);
}

.row {
  display: grid;
  grid-template-columns: 72px minmax(180px, 1fr) minmax(150px, 0.55fr) minmax(220px, 0.8fr);
  gap: 12px;
  align-items: center;
  padding: 8px 12px 8px 8px;
}

.row-media {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 52px;
  --image-bg-width: min(42px, 72%);
  --image-crop-y: 12%;
  --image-bg-height: min(31.9px, 54.72%);
  --image-crop-scale: 1;
  --marker-height: 4px;
  --marker-top: calc(50% + var(--image-bg-height) / 2 - var(--marker-height) / 2);
  --marker-width: min(29.4px, 50.4%);
  border: 1px solid rgba(196, 207, 226, 0.14);
  border-radius: 6px;
}

.row-media img {
  position: relative;
  z-index: 1;
  display: block;
  width: min(42px, 72%);
  height: min(42px, 72%);
  clip-path: inset(var(--image-crop-y) 0);
  object-fit: contain;
  transform: scale(var(--image-crop-scale));
  transform-origin: center;
}

.row-media .placeholder {
  font-size: 10px;
}

.row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.row-stats,
.stats-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
  color: #b7c0cf;
  font-size: 12px;
  font-weight: 700;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 7px;
  overflow-wrap: anywhere;
  border-radius: 999px;
  background: rgba(112, 217, 167, 0.1);
  border: 1px solid rgba(112, 217, 167, 0.42);
  color: #70d9a7;
}

.unique-stat {
  flex: 0 0 auto;
  color: #e3b45f;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.row-stats.empty-stats,
.stats-list.empty-stats {
  font-weight: 600;
}

.name-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.sub-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

h2 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.25;
}

.grade {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(237, 242, 248, 0.12);
  color: #d9e2ee;
  font-size: 12px;
  font-weight: 700;
}

.grade.Common {
  color: #c7d0dc;
}

.grade.Uncommon {
  color: #70d9a7;
}

.grade.Rare {
  color: #8dbdff;
}

.grade.Epic {
  color: #c6a1ff;
}

.grade.Legend,
.grade.Mythic {
  color: var(--gold);
}

.english,
.meta,
.drawer-english,
.code {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #b7c0cf;
  font-size: 13px;
}

.code {
  flex: 0 0 auto;
  font-weight: 700;
  text-align: right;
}

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

.tags span {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(237, 242, 248, 0.1);
  color: #d9e2ee;
  font-size: 12px;
  font-weight: 700;
}

.tags .type {
  background: rgba(72, 171, 190, 0.22);
  color: #a8e7f1;
}

.empty {
  margin: 48px 0;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.detail-panel {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: rgba(8, 12, 18, 0.62);
  border: 1px solid rgba(196, 207, 226, 0.18);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(4, 8, 14, 0.22);
  color: #edf2f8;
}

.empty-detail {
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #b7c0cf;
  font-weight: 700;
}

.drawer-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 230px;
  --image-bg-width: min(140px, 46%);
  --image-crop-y: 12%;
  --image-bg-height: min(106.4px, 34.96%);
  --image-crop-scale: 1;
  --marker-height: 7px;
  --marker-top: calc(50% + var(--image-bg-height) / 2 - var(--marker-height) / 2);
  --marker-width: min(98px, 32.2%);
  border-bottom: 1px solid rgba(196, 207, 226, 0.14);
  border-radius: 8px 8px 0 0;
}

.drawer-media img {
  position: relative;
  z-index: 1;
  width: min(140px, 46%);
  height: min(140px, 46%);
  clip-path: inset(var(--image-crop-y) 0);
  object-fit: contain;
  transform: scale(var(--image-crop-scale));
  transform-origin: center;
}

.material-list {
  display: grid;
  gap: 8px;
}

.material-item {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(196, 207, 226, 0.18);
  border-radius: 8px;
  background: rgba(237, 242, 248, 0.06);
}

.material-media {
  position: relative;
  display: grid;
  place-items: center;
  width: 60px;
  height: 54px;
  --image-bg-width: min(40px, 72%);
  --image-crop-y: 12%;
  --image-bg-height: min(30.4px, 54.72%);
  --image-crop-scale: 1;
  --marker-height: 4px;
  --marker-top: calc(50% + var(--image-bg-height) / 2 - var(--marker-height) / 2);
  --marker-width: min(28px, 50.4%);
  border: 1px solid rgba(196, 207, 226, 0.14);
  border-radius: 6px;
}

.material-media img {
  position: relative;
  z-index: 1;
  display: block;
  width: min(40px, 72%);
  height: min(40px, 72%);
  clip-path: inset(var(--image-crop-y) 0);
  object-fit: contain;
  transform: scale(var(--image-crop-scale));
  transform-origin: center;
}

.material-media .placeholder {
  font-size: 9px;
}

.material-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.material-main h4 {
  margin: 0;
  overflow-wrap: anywhere;
  color: #edf2f8;
  font-size: 14px;
  line-height: 1.25;
}

.material-main p {
  margin: 0;
  overflow-wrap: anywhere;
  color: #b7c0cf;
  font-size: 12px;
}

.drawer-content {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.drawer-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.drawer-heading h2 {
  font-size: 22px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.detail-tags span {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(237, 242, 248, 0.1);
  color: #d9e2ee;
  font-size: 12px;
  font-weight: 700;
}

.detail-tags .type {
  background: rgba(72, 171, 190, 0.22);
  color: #a8e7f1;
}

.detail-tags .grade {
  background: rgba(237, 242, 248, 0.12);
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(100px, 0.45fr) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.detail-list dt {
  color: #b7c0cf;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-list a {
  color: #a8e7f1;
  font-weight: 800;
}

.detail-list a:hover {
  text-decoration-thickness: 2px;
}

.detail-section {
  display: grid;
  gap: 8px;
}

.detail-section h3 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  color: #b7c0cf;
}

.detail-section p {
  margin: 0;
}

.item-skill-list {
  display: grid;
  gap: 8px;
}

.item-skill {
  display: grid;
  gap: 6px;
}

.item-skill h4 {
  margin: 0;
  color: #e3b45f;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.item-skill p {
  margin: 0;
  color: #d9e2ee;
  font-size: 13px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.skill-maintenance-panel {
  gap: 0;
}

.skill-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(196, 207, 226, 0.14);
}

.skill-panel-header h2 {
  font-size: 20px;
}

.link-button {
  flex: 0 0 auto;
  min-width: 104px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(72, 171, 190, 0.82);
  border-radius: 6px;
  background: #1f7a8c;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.link-button:hover:not(:disabled) {
  background: #125e6b;
}

.link-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.skill-selection-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(196, 207, 226, 0.14);
  color: #b7c0cf;
  font-size: 13px;
  font-weight: 800;
}

.skill-selection-summary span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.skill-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(196, 207, 226, 0.14);
}

.skill-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.skill-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(196, 207, 226, 0.18);
  border-radius: 8px;
  background: rgba(237, 242, 248, 0.06);
  color: #edf2f8;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.skill-row:hover,
.skill-row:focus-visible {
  border-color: rgba(72, 171, 190, 0.72);
  outline: none;
}

.skill-row.selected {
  border-color: rgba(72, 171, 190, 0.92);
  background: rgba(11, 27, 34, 0.82);
  box-shadow: 0 0 0 2px rgba(72, 171, 190, 0.3);
}

.skill-row.linked {
  border-color: rgba(112, 217, 167, 0.42);
}

.skill-row-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.skill-row-title h3 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.25;
}

.skill-row-title span,
.skill-row-meta span {
  flex: 0 0 auto;
  color: #b7c0cf;
  font-size: 12px;
  font-weight: 800;
}

.skill-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-row-meta span {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(237, 242, 248, 0.1);
}

.skill-row-meta .skill-use.usable,
.skill-row-meta .skill-linked {
  background: rgba(112, 217, 167, 0.1);
  color: #70d9a7;
}

.skill-row-meta .skill-use.unused {
  background: rgba(242, 164, 170, 0.12);
  color: #f2a4aa;
}

.skill-row p {
  margin: 0;
  color: #d9e2ee;
  font-size: 13px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.skill-empty {
  margin: 24px 0 36px;
}

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

  .detail-panel {
    order: -1;
  }

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

  .search {
    grid-column: 1 / -1;
  }

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

  .row .tags {
    grid-column: 2 / -1;
  }

  .row-stats {
    grid-column: 2 / -1;
  }

  .detail-panel {
    position: static;
    max-height: none;
    border-left: 0;
  }

  .skill-maintenance-panel {
    max-height: 70vh;
  }
}

@media (max-width: 860px) {
  .preview-layout {
    grid-template-columns: minmax(0, 1fr) 180px;
  }
}

@media (max-width: 560px) {
  body {
    padding-bottom: 178px;
  }

  .site-header-inner {
    align-items: flex-start;
    flex-direction: column;
    width: min(100% - 20px, 1440px);
    padding: 12px 0;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav-link {
    justify-content: flex-start;
  }

  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 14px;
  }

  .color-custom-main {
    width: min(100% - 20px, 1440px);
    padding: 14px 0 40px;
  }

  .page-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status {
    text-align: left;
  }

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

  .search {
    grid-column: auto;
  }

  .row {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    padding: 8px;
  }

  .row-media {
    width: 54px;
    height: 48px;
  }

  .row .tags {
    grid-column: 1 / -1;
  }

  .row-stats {
    grid-column: 1 / -1;
  }

  .drawer-media {
    min-height: 120px;
  }

  .skill-panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .link-button {
    width: 100%;
  }

  .skill-controls {
    grid-template-columns: 1fr;
  }

  .color-row {
    grid-template-columns: minmax(112px, 38%) minmax(110px, 1fr);
    gap: 8px 10px;
  }

  .color-label {
    grid-column: 1 / -1;
  }

  .color-swatch {
    width: 100%;
  }
}

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

  .color-row {
    grid-template-columns: minmax(112px, 42%) minmax(120px, 1fr);
  }

}
