/* Backwards-compatible wrapper. Global theme values now live in settings.css. */
@import './settings.css';

.c1-colors-page {
  width: min(100%, 1680px);
  max-width: none;
}

.c1-colors-shell {
  grid-template-columns: minmax(0, 1.24fr) minmax(320px, 460px);
}

.c1-color-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.c1-color-summary__item {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 18px;
  border: 1px solid var(--c1-border);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.c1-color-summary__item span:first-child {
  color: var(--c1-secondary);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.c1-color-summary__item span:last-child {
  color: var(--c1-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.c1-color-palettes {
  display: grid;
  gap: 26px;
  margin-top: 28px;
}

.c1-color-loading {
  margin: 0;
  color: var(--c1-muted);
}

.c1-color-group {
  display: grid;
  gap: 14px;
}

.c1-color-group__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.c1-color-group__header h3 {
  margin: 0;
  color: var(--c1-secondary);
  font-size: 1.08rem;
  line-height: 1.25;
}

.c1-color-group__count {
  color: var(--c1-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.c1-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.c1-color-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--c1-border);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.c1-color-card:hover,
.c1-color-card:focus-visible,
.c1-color-card.is-active {
  border-color: rgb(2 118 191 / 0.34);
  box-shadow: 0 18px 30px rgb(2 118 191 / 0.12);
  transform: translateY(-1px);
}

.c1-color-card:focus-visible {
  outline: 3px solid rgb(2 118 191 / 0.22);
  outline-offset: 2px;
}

.c1-color-card.is-active {
  background:
    linear-gradient(180deg, rgb(2 118 191 / 0.06), #ffffff 36%),
    #ffffff;
}

.c1-color-swatch,
.c1-color-preview__swatch {
  display: inline-block;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border: 4px solid #ffffff;
  border-radius: 999px;
  background:
    linear-gradient(45deg, rgb(209 213 219 / 0.7) 25%, transparent 25% 75%, rgb(209 213 219 / 0.7) 75%),
    linear-gradient(45deg, rgb(209 213 219 / 0.7) 25%, transparent 25% 75%, rgb(209 213 219 / 0.7) 75%),
    var(--c1-color-value, #0276bf);
  background-position: 0 0, 8px 8px, 0 0;
  background-size: 16px 16px, 16px 16px, auto;
  box-shadow:
    0 0 0 1px rgb(8 31 49 / 0.08),
    0 12px 22px rgb(8 31 49 / 0.14);
}

.c1-color-swatch::after,
.c1-color-preview__swatch::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--c1-color-value, #0276bf);
}

.c1-color-card__meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.c1-color-card__name {
  color: var(--c1-secondary);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.c1-color-card__hex {
  color: var(--c1-text);
  font-family: var(--c1-font-family-roboto);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.3;
}

.c1-color-card__token {
  color: var(--c1-muted);
  font-size: 0.72rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.c1-color-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 130px;
  margin: 24px 0 0;
  padding: 22px;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 22px;
  background: linear-gradient(135deg, rgb(255 255 255 / 0.11), rgb(255 255 255 / 0.04));
}

.c1-color-preview__swatch {
  width: 70px;
  height: 70px;
}

.c1-color-preview__label,
.c1-color-preview__hex {
  margin: 0;
}

.c1-color-preview__label {
  color: rgb(232 240 251 / 0.82);
  font-size: 0.92rem;
  line-height: 1.4;
}

.c1-color-preview__hex {
  margin-top: 4px;
  color: #f8fbff;
  font-family: var(--c1-font-family-roboto);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.c1-color-used-list {
  display: grid;
  gap: 18px;
}

.c1-color-used-family {
  display: grid;
  gap: 8px;
}

.c1-color-used-family__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 22px;
}

.c1-color-used-family__header h3 {
  margin: 0;
  color: rgb(232 240 251 / 0.78);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.25;
  text-transform: uppercase;
}

.c1-color-used-family__header span {
  color: rgb(232 240 251 / 0.58);
  font-family: var(--c1-font-family-roboto);
  font-size: 0.68rem;
  font-weight: 700;
}

.c1-color-used-family__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
}

.c1-color-used-list__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 14px;
  padding: 7px 8px 7px 7px;
  background: rgb(255 255 255 / 0.075);
  color: #f8fbff;
  font-family: var(--c1-font-family-roboto);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.c1-color-used-list__item:hover,
.c1-color-used-list__item:focus-visible {
  background: rgb(255 255 255 / 0.14);
  border-color: rgb(255 255 255 / 0.28);
  transform: translateY(-1px);
}

.c1-color-used-list__item:focus-visible {
  outline: 3px solid rgb(255 255 255 / 0.16);
  outline-offset: 2px;
}

.c1-color-used-list__dot {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background:
    linear-gradient(45deg, rgb(209 213 219 / 0.7) 25%, transparent 25% 75%, rgb(209 213 219 / 0.7) 75%),
    linear-gradient(45deg, rgb(209 213 219 / 0.7) 25%, transparent 25% 75%, rgb(209 213 219 / 0.7) 75%),
    var(--c1-color-value, #0276bf);
  background-position: 0 0, 5px 5px, 0 0;
  background-size: 10px 10px, 10px 10px, auto;
  box-shadow: 0 0 0 1px rgb(8 31 49 / 0.12);
}

.c1-color-used-list__dot::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--c1-color-value, #0276bf);
}

@media (max-width: 1120px) {
  .c1-colors-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .c1-color-summary {
    grid-template-columns: 1fr;
  }

  .c1-color-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .c1-color-summary__item,
  .c1-color-card,
  .c1-color-preview {
    border-radius: 18px;
  }

  .c1-color-card {
    min-height: 96px;
    padding: 14px;
  }

  .c1-color-preview {
    align-items: flex-start;
    padding: 18px;
  }

  .c1-color-preview__hex {
    font-size: 1.25rem;
  }
}
