.character-page-grid{
  display:grid;
  grid-template-columns: minmax(280px, 360px) minmax(420px, 1fr);
  gap: 16px;
  align-items:start;
}

.cm-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top: 10px;
}

.cm-card{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px;
  border-radius:10px;
  background: rgba(255,255,255,0.06);
}

.cm-card-main{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.cm-card-name{
  font-weight:700;
  font-size:15px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.cm-card-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}

#characterListView{
  min-height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding-bottom: 32px;
}

@media (max-width: 980px){
  .cm-card{
    flex-direction:column;
    align-items:flex-start;
  }

  .cm-card-actions{
    width:100%;
    justify-content:flex-start;
  }
}

.character-editor-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}

.character-maker-block{
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.character-maker-label{
  font-weight:700;
  margin-bottom:8px;
}

.character-maker-row-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}

.character-maker-stats{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.character-maker-stat-row{
  display:grid;
  grid-template-columns: 1fr 1fr auto;
  gap:8px;
  align-items:center;
}

.character-maker-validation{
  min-height:72px;
  padding:10px 12px;
  border-radius:10px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
  white-space: pre-wrap;
}

.character-maker-validation.ok{
  border-color: rgba(76,175,80,0.55);
}

.character-maker-validation.error{
  border-color: rgba(184,74,74,0.7);
}

.character-maker-json{
  min-height: 360px;
  font-family: Consolas, Monaco, monospace;
  white-space: pre;
}

.cm-editor-empty{
  min-height: 220px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

#characterListView{
  min-height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding-bottom: 32px;
}

@media (max-width: 980px){
  .character-page-grid{
    grid-template-columns: 1fr;
  }

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

  .cm-card-actions{
    width:100%;
    justify-content:flex-start;
  }

  .character-maker-stat-row{
    grid-template-columns: 1fr;
  }
}

.cm-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:10px;
}

.cm-card{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px;
  border-radius:10px;
  background: rgba(255,255,255,0.06);
}

.cm-card-main{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.cm-card-name{
  font-weight:700;
  font-size:15px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.cm-card-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}

#characterListView,
#characterEditorView{
  min-height:100vh;
  overflow-y:auto;
  box-sizing:border-box;
  padding-bottom:32px;
}

.character-editor-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}

.character-maker-block{
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.character-maker-label{
  font-weight:700;
  margin-bottom:8px;
}

.character-maker-row-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}

.character-maker-stats{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.character-maker-stat-row{
  display:grid;
  grid-template-columns: 1fr 1fr auto;
  gap:8px;
  align-items:center;
}

.character-maker-validation{
  min-height:72px;
  padding:10px 12px;
  border-radius:10px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
  white-space: pre-wrap;
}

.character-maker-validation.ok{
  border-color: rgba(76,175,80,0.55);
}

.character-maker-validation.error{
  border-color: rgba(184,74,74,0.7);
}

.character-maker-json{
  min-height: 360px;
  font-family: Consolas, Monaco, monospace;
  white-space: pre;
}

@media (max-width: 980px){
  .cm-card{
    flex-direction:column;
    align-items:flex-start;
  }

  .cm-card-actions{
    width:100%;
    justify-content:flex-start;
  }

  .character-maker-stat-row{
    grid-template-columns:1fr;
  }
}