html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(122, 162, 255, .22), transparent),
    radial-gradient(900px 500px at 10% 0%, rgba(139, 213, 255, .18), transparent),
    var(--bg);
  color: var(--ink);
  line-height: 1.8;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, rgba(19, 24, 42, .95), rgba(19, 24, 42, .85));
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--border);
}

.wrap {
  max-width: 1100px;
  margin: auto;
  padding: clamp(12px, 2vw, 20px);
}

.title {
  display: flex;
  align-items: center;
  gap: 12px
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 8px 24px rgba(122, 162, 255, .35)
}

.logolink {
  color: var(--ink);
}

nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px
}

nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent
}

nav a:hover {
  color: var(--ink);
  border-color: var(--border);
  background: rgba(122, 162, 255, .08)
}

main {
  padding: clamp(24px, 4vw, 40px) 0;
}

.lead {
  font-size: clamp(16px, 1.8vw, 18px);
  color: var(--muted)
}

.grid {
  display: grid;
  gap: 16px
}

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

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

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

@media (max-width:720px) {

  .g-2,
  .g-3 {
    grid-template-columns: 1fr
  }
}

.card {
  background: linear-gradient(180deg, rgba(19, 24, 42, .6), rgba(19, 24, 42, .9));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  padding: 2rem;
}

section.card+section.card {
  margin-top: 2rem;
}

.cardLink {
  display: block;
  color: var(--ink);
  height: 100%;
  padding: 18px;
}

.contentsCardWrap {
  display: flex;
  width: 100%;
  list-style: none;
  padding: 0;
  gap: 10px;
  flex-wrap: wrap;
}

.contentsCard {
  background: linear-gradient(180deg, rgba(19, 24, 42, .6), rgba(19, 24, 42, .9));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  width: calc((100% - 20px) / 3);
}

.sectionCard {
  background: linear-gradient(180deg, rgba(19, 24, 42, .6), rgba(19, 24, 42, .9));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25)
}

.sectionCard+.sectionCard {
  margin-top: 2rem;
}

.contentsTitle a {
  color: var(--ink);
}

.badge {
  display: inline-block;
  padding: .25em .6em;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  color: var(--muted)
}

.ok {
  color: #052;
  background: linear-gradient(180deg, rgba(141, 240, 165, .2), transparent);
  border-color: rgba(141, 240, 165, .5)
}

.warn {
  color: #402;
  background: linear-gradient(180deg, rgba(255, 212, 121, .2), transparent);
  border-color: rgba(255, 212, 121, .55)
}

.kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
  background: rgba(122, 162, 255, .1);
  padding: .2em .4em;
  border: 1px solid var(--border);
  border-radius: 6px
}

pre {
  background: var(--code);
  color: #d7e2ff;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: auto
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace
}

.toc {
  font-size: 14px
}

.toc li {
  margin: .12em 0
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden
}

.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top
}

.table thead th {
  position: sticky;
  top: 64px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  z-index: 1
}

.table tr:not(:last-child) td {
  border-bottom: 1px dashed var(--border)
}

footer {
  margin-top: 40px;
  padding: 30px 0;
  color: var(--muted);
  border-top: 1px solid var(--border)
}

.small {
  font-size: 13px
}

.hint {
  color: var(--muted);
  font-size: .95em
}

.toc a {
  color: var(--brand);
  text-decoration: none
}

.toc a:hover {
  text-decoration: underline
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(122, 162, 255, .07);
  color: var(--muted);
  font-size: 12px
}

.chip b {
  color: var(--ink)
}

.template-card {
  padding: 0.5rem;
  border: 1px solid #00d8ff;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  background: #111;
  color: #0ff;
  opacity: 0.6;
  transition: all 0.2s;
}

.template-card:hover {
  opacity: 1;
  transform: scale(1.05);
}

#addExerciseBtn {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background: #00d8ff;
  color: #111;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

#addExerciseBtn:hover {
  background: #00b0d8;
}

#templateUI select,
#templateUI button {
  background: #111;
  color: #0ff;
  border: 1px solid #00d8ff;
  border-radius: 5px;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  transition: 0.2s;
}

#templateUI button:hover,
#templateUI select:hover {
  background: #00d8ff;
  color: #111;
}