:root {
  --cm-bg: #040207;
  --cm-panel: rgba(12, 8, 18, 0.92);
  --cm-panel-soft: rgba(30, 19, 42, 0.88);
  --cm-purple: #8d54ff;
  --cm-purple-2: #b88cff;
  --cm-silver: #e8e4f2;
  --cm-muted: #c8bfd8;
  --cm-line: rgba(220, 204, 255, 0.26);
  --cm-line-strong: rgba(232, 228, 242, 0.48);
  --cm-glow: rgba(141, 84, 255, 0.38);
  --cm-page: min(1480px, calc(100vw - 48px));
  --cm-gap: 28px;
  --cm-pad: clamp(28px, 3.4vw, 56px);
  --cm-radius: 8px;
  --cm-font: "Inter", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cm-bg);
}

body.cm-rendered {
  margin: 0;
  min-height: 100vh;
  color: #f7f3ff;
  font-family: var(--cm-font);
  font-size: 17px;
  line-height: 1.55;
  background:
    radial-gradient(circle at 15% 5%, rgba(109, 69, 190, 0.26), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(120, 42, 86, 0.2), transparent 34%),
    linear-gradient(180deg, #06020b 0%, #08040d 48%, #030204 100%);
  overflow-x: hidden;
}

body.cm-rendered a {
  color: inherit;
  text-decoration: none;
}

body.cm-rendered h1,
body.cm-rendered h2,
body.cm-rendered h3,
body.cm-rendered p,
body.cm-rendered a,
body.cm-rendered button,
body.cm-rendered code,
body.cm-rendered li {
  overflow-wrap: anywhere;
}

.cm-shell {
  min-height: 100vh;
}

.cm-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(184, 140, 255, 0.52);
  background: rgba(5, 3, 9, 0.94);
  backdrop-filter: blur(18px);
}

.cm-nav {
  width: var(--cm-page);
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cm-brand {
  min-width: 190px;
  padding: 11px 20px;
  border: 1px solid rgba(184, 140, 255, 0.5);
  border-left: 4px solid var(--cm-purple);
  border-radius: 6px;
  color: var(--cm-silver);
  font-weight: 900;
  letter-spacing: 0.05em;
  text-shadow: 0 0 18px rgba(232, 228, 242, 0.32);
  white-space: nowrap;
}

.cm-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.cm-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--cm-muted);
  font-weight: 800;
}

.cm-links a:hover,
.cm-links a[aria-current="page"] {
  color: #fff;
  border-color: rgba(184, 140, 255, 0.52);
  background: linear-gradient(180deg, rgba(141, 84, 255, 0.82), rgba(74, 43, 126, 0.82));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.cm-main {
  width: var(--cm-page);
  margin: 0 auto;
  padding: 56px 0 72px;
}

.cm-stack > * + * {
  margin-top: var(--cm-gap);
}

.cm-panel,
.cm-card {
  position: relative;
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  background:
    linear-gradient(135deg, rgba(70, 58, 111, 0.34), rgba(38, 12, 28, 0.2) 38%, rgba(6, 4, 10, 0.96) 76%),
    var(--cm-panel);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.26);
}

.cm-panel {
  padding: var(--cm-pad);
}

.cm-card {
  padding: 28px;
}

.cm-panel::before,
.cm-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 26px;
  width: min(210px, 38%);
  height: 2px;
  background: linear-gradient(90deg, var(--cm-silver), var(--cm-purple), transparent);
  opacity: 0.8;
}

.cm-kicker {
  margin: 0 0 14px;
  color: #d8c7ff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cm-title {
  margin: 0;
  max-width: 100%;
  color: #faf7ff;
  font-size: clamp(48px, 7vw, 106px);
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 950;
  text-shadow: 0 10px 34px rgba(141, 84, 255, 0.22);
}

.cm-title-small {
  font-size: clamp(42px, 5vw, 82px);
}

.cm-subtitle {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--cm-muted);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 650;
}

.cm-copy {
  color: var(--cm-muted);
  margin: 16px 0 0;
  max-width: 820px;
}

.cm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.cm-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid var(--cm-line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-weight: 900;
}

.cm-btn:hover {
  border-color: var(--cm-line-strong);
  background: rgba(255, 255, 255, 0.09);
}

.cm-primary {
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, #8d54ff, #6731d0 62%, #d5c9ff);
  box-shadow: 0 0 28px rgba(141, 84, 255, 0.26);
}

.cm-grid-2,
.cm-grid-3,
.cm-grid-4,
.cm-grid-5,
.cm-home-grid {
  display: grid;
  gap: var(--cm-gap);
}

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

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

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

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

.cm-home-grid {
  grid-template-columns: 2fr 1fr;
}

.cm-home-hero {
  min-height: clamp(560px, 70vh, 820px);
  padding: clamp(36px, 5vw, 72px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5, 3, 9, 0.96), rgba(7, 4, 12, 0.74) 32%, rgba(5, 3, 9, 0.22) 68%, rgba(5, 3, 9, 0.76)),
    var(--hero-image) center / cover no-repeat;
}

.cm-hero-inner {
  width: min(620px, 100%);
}

.cm-home-hero .cm-title {
  font-size: clamp(58px, 8vw, 124px);
}

.cm-status {
  width: min(420px, 100%);
  margin-top: 30px;
  padding: 18px 22px;
  border: 1px solid rgba(184, 140, 255, 0.45);
  border-left: 5px solid var(--cm-purple);
  border-radius: 6px;
  background: rgba(6, 3, 10, 0.82);
}

.cm-status strong {
  display: block;
  margin-bottom: 4px;
}

.cm-placeholder {
  min-height: 170px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 140, 255, 0.2);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(111, 63, 168, 0.55), rgba(37, 19, 58, 0.7));
  color: #fff;
  font-weight: 900;
}

.cm-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

.cm-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.6fr);
  gap: 16px;
  align-items: center;
  min-height: 58px;
  padding: 12px 16px;
  border: 1px solid var(--cm-line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.cm-row strong {
  color: #efe9ff;
}

.cm-code {
  display: block;
  margin-top: 18px;
  padding: 22px;
  border: 1px solid rgba(141, 84, 255, 0.52);
  border-radius: 6px;
  background: rgba(2, 1, 5, 0.82);
  color: #fff;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.cm-card h3,
.cm-panel h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.15;
}

.cm-card h3 {
  font-size: 22px;
}

.cm-card p {
  color: var(--cm-muted);
  margin: 14px 0 0;
}

.cm-card .cm-actions {
  margin-top: 20px;
}

.cm-friend {
  min-height: 132px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
}

.cm-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: radial-gradient(circle at 35% 25%, #cda9ff, #8d54ff 48%, #533083);
  color: #fff;
  font-weight: 950;
}

.cm-friend small,
.cm-tag {
  color: #d9ccf1;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.cm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.cm-tag {
  padding: 8px 12px;
  border: 1px solid var(--cm-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  text-transform: none;
}

.cm-about-visual {
  min-height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 44%, rgba(141, 84, 255, 0.34), transparent 38%),
    linear-gradient(145deg, rgba(46, 26, 75, 0.9), rgba(8, 4, 12, 0.92));
}

.cm-chibi {
  width: min(290px, 74%);
  height: auto;
  filter: drop-shadow(0 22px 28px rgba(0, 0, 0, 0.45));
}

.cm-tool-buttons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.cm-tool-buttons .cm-btn {
  width: 100%;
}

.cm-footer-card {
  width: var(--cm-page);
  margin: 40px auto 0;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}

.cm-footer {
  width: var(--cm-page);
  margin: 0 auto;
  padding: 28px 0 36px;
  border-top: 1px solid var(--cm-line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--cm-muted);
}

.cm-footer strong {
  color: #fff;
}

.cm-note {
  padding: 22px;
  border: 1px solid rgba(204, 172, 94, 0.42);
  border-radius: 6px;
  background: rgba(62, 39, 8, 0.16);
  color: #efe5d0;
}

@media (max-width: 1100px) {
  :root {
    --cm-page: min(100% - 24px, 980px);
  }

  .cm-nav,
  .cm-footer,
  .cm-footer-card {
    width: var(--cm-page);
  }

  .cm-grid-2,
  .cm-grid-3,
  .cm-grid-4,
  .cm-grid-5,
  .cm-home-grid,
  .cm-tool-buttons {
    grid-template-columns: 1fr;
  }

  .cm-nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .cm-links {
    justify-content: flex-start;
  }

  .cm-home-hero {
    min-height: 640px;
  }
}

@media (max-width: 640px) {
  :root {
    --cm-page: calc(100vw - 20px);
    --cm-gap: 18px;
  }

  .cm-main {
    padding-top: 28px;
  }

  .cm-panel,
  .cm-card {
    padding: 22px;
  }

  .cm-title {
    font-size: clamp(42px, 17vw, 72px);
  }

  .cm-home-hero .cm-title {
    font-size: clamp(52px, 19vw, 84px);
  }

  .cm-row,
  .cm-friend,
  .cm-footer-card,
  .cm-footer {
    grid-template-columns: 1fr;
  }

  .cm-brand {
    min-width: 0;
    width: 100%;
  }
}
